evolclaw 3.1.4 → 3.1.5
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 +10 -0
- package/dist/agents/claude-runner.js +348 -156
- package/dist/agents/kit-renderer.js +176 -21
- package/dist/aun/aid/agentmd.js +68 -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/p2p.js +26 -2
- package/dist/aun/rpc/connection.js +23 -30
- package/dist/channels/aun.js +77 -88
- package/dist/channels/dingtalk.js +1 -0
- package/dist/channels/feishu.js +270 -190
- package/dist/channels/qqbot.js +1 -0
- package/dist/channels/wechat.js +1 -0
- package/dist/channels/wecom.js +1 -0
- package/dist/cli/agent.js +11 -5
- package/dist/cli/bench.js +40 -23
- package/dist/cli/index.js +170 -44
- package/dist/cli/init-channel.js +5 -1
- package/dist/cli/model.js +324 -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/core/channel-loader.js +7 -4
- package/dist/core/command-handler.js +81 -86
- package/dist/core/evolagent-registry.js +1 -1
- package/dist/core/evolagent.js +4 -4
- package/dist/core/interaction-router.js +59 -0
- package/dist/core/message/message-bridge.js +6 -6
- package/dist/core/message/message-log.js +2 -2
- package/dist/core/message/message-processor.js +86 -101
- 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 +40 -49
- 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/scheduler.js +2 -1
- package/dist/index.js +6 -2
- package/dist/ipc.js +22 -0
- package/kits/docs/GUIDE.md +2 -2
- package/kits/docs/INDEX.md +11 -7
- package/kits/docs/channels/aun.md +56 -17
- package/kits/docs/channels/feishu.md +41 -12
- package/kits/docs/context-assembly.md +181 -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 +82 -0
- package/kits/docs/evolclaw/msg.md +86 -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 +11 -0
- package/kits/docs/venues/private.md +10 -0
- package/kits/eck_manifest.json +72 -36
- package/kits/rules/01-overview.md +20 -10
- package/kits/rules/06-channel.md +30 -27
- package/kits/templates/system-fragments/session.md +10 -3
- package/kits/templates/system-fragments/venue.md +9 -0
- package/package.json +11 -6
- 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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ec ctl — 会话运行时自管理
|
|
2
|
+
|
|
3
|
+
对**当前会话**的运行时自管理:切模型、调推理强度、压缩上下文、切权限、重启服务。触发词:切模型/推理强度/压缩上下文/切权限/重启。
|
|
4
|
+
|
|
5
|
+
> ctl 命令通过 IPC 转发给 daemon,仅在 evolclaw 托管环境中可用(依赖 `EVOLCLAW_SESSION_ID`)。
|
|
6
|
+
|
|
7
|
+
## 查询
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ec ctl status # 查看会话状态
|
|
11
|
+
ec ctl check # 检查渠道健康状态
|
|
12
|
+
ec ctl pwd # 显示当前项目路径
|
|
13
|
+
ec ctl help # 显示帮助
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 配置
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
ec ctl model [model-id] # 查看/切换模型(如 opus, sonnet, haiku)
|
|
20
|
+
ec ctl effort [low|medium|high] # 查看/切换推理强度
|
|
21
|
+
ec ctl compact # 压缩当前会话上下文
|
|
22
|
+
ec ctl perm [mode] # 查看/切换权限模式
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 消息(兜底用)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
ec ctl send "<text>" # 主动发送文本(proactive 模式)
|
|
29
|
+
ec ctl file [channel] <path> # 发送项目内文件
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> 发消息**首选 `ec msg send <self-aid> <peer-id> "<text>"`**(见 msg.md)。
|
|
33
|
+
> `ec ctl send` 只在拿不到自己的 AID 时兜底——它自动继承当前会话的 AID 和对端。
|
|
34
|
+
|
|
35
|
+
## 运维
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
ec ctl restart [channel] # 重启服务,或重连指定渠道
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 相关命令集
|
|
42
|
+
|
|
43
|
+
- agent 全生命周期管理(创建/启停/配置)→ `ec agent`(见 agent.md)
|
|
44
|
+
- AID 身份与 agent.md 名片 → `ec aid`(见 aid.md)
|
|
45
|
+
|
|
46
|
+
ctl 内也转发了 `ec ctl agent <subcommand>`,但完整功能请直接用 `ec agent`。
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# ec group — 群聊消息与群管理
|
|
2
|
+
|
|
3
|
+
群聊场景下收发消息、管理群与成员。触发词:群发/建群/邀请/踢人/退群/群成员。
|
|
4
|
+
|
|
5
|
+
以自己的 AID 为发送者(`<from>`),群 AID 为 `<group-id>`。
|
|
6
|
+
|
|
7
|
+
## 消息
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 文本
|
|
11
|
+
ec group send <from> <group-id> "<text>"
|
|
12
|
+
|
|
13
|
+
# 文件(--as image|video|voice|file)
|
|
14
|
+
ec group send <from> <group-id> --file <path> [--as <type>]
|
|
15
|
+
|
|
16
|
+
# 自定义 payload
|
|
17
|
+
ec group send <from> <group-id> --payload '<json>'
|
|
18
|
+
|
|
19
|
+
# 拉取群消息
|
|
20
|
+
ec group pull <from> <group-id> [--after-seq <N>] [--limit <N>] [--app <name>]
|
|
21
|
+
|
|
22
|
+
# 确认已读
|
|
23
|
+
ec group ack <from> <group-id> <seq> [--app <name>]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
@ 成员:
|
|
27
|
+
- `--mention <aid>` — @ 某个成员(可多次)
|
|
28
|
+
- `--mention-all` — @ 所有人
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
ec group send <from> <group-id> "@bob 看下 PR" --mention bob.agentid.pub
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 群管理
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 创建群
|
|
38
|
+
ec group create <from> "<name>" [--visibility public|private] [--description "<desc>"] [--join-mode <mode>]
|
|
39
|
+
|
|
40
|
+
# 列出我加入的群
|
|
41
|
+
ec group list <from> [--size <N>]
|
|
42
|
+
|
|
43
|
+
# 查看群详情
|
|
44
|
+
ec group info <from> <group-id>
|
|
45
|
+
|
|
46
|
+
# 修改群信息
|
|
47
|
+
ec group update <from> <group-id> [--name "<name>"] [--description "<desc>"]
|
|
48
|
+
|
|
49
|
+
# 解散群
|
|
50
|
+
ec group dissolve <from> <group-id>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 成员
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 申请加入
|
|
57
|
+
ec group join <from> <group-id> [--message "<msg>"] [--answer "<answer>"]
|
|
58
|
+
|
|
59
|
+
# 退出群
|
|
60
|
+
ec group leave <from> <group-id>
|
|
61
|
+
|
|
62
|
+
# 邀请成员(可多个)
|
|
63
|
+
ec group invite <from> <group-id> <member-aid> [<member-aid>...]
|
|
64
|
+
|
|
65
|
+
# 踢出成员
|
|
66
|
+
ec group kick <from> <group-id> <member-aid>
|
|
67
|
+
|
|
68
|
+
# 列出群成员
|
|
69
|
+
ec group members <from> <group-id> [--page <N>] [--size <N>]
|
|
70
|
+
|
|
71
|
+
# 查看在线成员
|
|
72
|
+
ec group online <from> <group-id>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 通用约定
|
|
76
|
+
|
|
77
|
+
- `--format json` — 所有子命令通用
|
|
78
|
+
- `--app <name>` — 指应用 slot(独立消费通道,不影响 daemon)
|
|
79
|
+
|
|
80
|
+
## 自主回复策略
|
|
81
|
+
|
|
82
|
+
群聊中默认被 @ 才响应,可通过 venue policy 配置其他触发条件。
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# ec msg — 私聊消息命令
|
|
2
|
+
|
|
3
|
+
私聊场景下收发消息的命令集。触发词:回复/发消息/拉取/撤回/查在线。
|
|
4
|
+
|
|
5
|
+
以自己的 AID 为发送者(`<from>`),对端 AID 为 `<to>`。
|
|
6
|
+
|
|
7
|
+
## 发送消息
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 文本(明文)
|
|
11
|
+
ec msg send <from> <to> "<text>"
|
|
12
|
+
|
|
13
|
+
# 文本(密文 E2EE)
|
|
14
|
+
ec msg send <from> <to> "<text>" --encrypt
|
|
15
|
+
|
|
16
|
+
# 文件:--as 可选 image|video|voice|file(默认按扩展名推断)
|
|
17
|
+
ec msg send <from> <to> --file <path> [--as <type>]
|
|
18
|
+
|
|
19
|
+
# 链接卡片
|
|
20
|
+
ec msg send <from> <to> --link <url> [--title "<title>"] [--description "<desc>"]
|
|
21
|
+
|
|
22
|
+
# 自定义 payload(JSON)
|
|
23
|
+
ec msg send <from> <to> --payload '<json>'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
发送相关选项:
|
|
27
|
+
- `--encrypt` — 端到端加密
|
|
28
|
+
- `--thread <id>` — 指定话题 ID(多话题路由)
|
|
29
|
+
- `--content-type <mime>` — 显式覆盖 MIME(仅 `--file`)
|
|
30
|
+
- `--text <说>` — 附件说明文字(仅 `--file`)
|
|
31
|
+
- `--transcript <text>` — 语音转写(仅 `--as voice`)
|
|
32
|
+
|
|
33
|
+
成功输出:`✓ 已发送 <message_id> seq=<n> status=<status>`
|
|
34
|
+
|
|
35
|
+
## 拉取消息
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
ec msg pull <from> --app <name>
|
|
39
|
+
ec msg pull <from> --app <name> --after-seq <N> --limit <N>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`--app <name>` 指定独立消费通道(slot)。**不传 `--app` 会与 daemon 共享 evolclaw 消费游标,可能影响 daemon 收消息。**
|
|
43
|
+
|
|
44
|
+
## 确认已读
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
ec msg ack <from> <seq> --app <name>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
同样:不传 `--app` 会推进与 daemon 共享的游标。
|
|
51
|
+
|
|
52
|
+
## 撤回消息
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
ec msg recall <from> <message-id> [<message-id>...]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 查询在线状态
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
ec msg online <from> <target-aid> [<target-aid>...]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
输出:`🟢` 在线 / `⚫` 离线。
|
|
65
|
+
|
|
66
|
+
## 通用约定
|
|
67
|
+
|
|
68
|
+
- `--format json` — 所有子命令通用,输出 JSON
|
|
69
|
+
- `--app <name>` — 指定应用 slot
|
|
70
|
+
|
|
71
|
+
## 自主回复策略
|
|
72
|
+
|
|
73
|
+
收到消息 ≠ 必须回复。是否回复、怎么回复、何时回复由 agent 自主决定。
|
|
74
|
+
|
|
75
|
+
加密策略:
|
|
76
|
+
- 对端发来密文消息时,回复也应使用 `--encrypt`(保持对话加密一致性)
|
|
77
|
+
- 对端发来明文消息时,默认明文回复
|
|
78
|
+
|
|
79
|
+
## 在当前会话中快速回复(备选)
|
|
80
|
+
|
|
81
|
+
仅当无法使用 `ec msg send` 时(如拿不到自己的 AID),可用 `ec ctl send`,它自动继承当前会话的 AID 和对端:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
ec ctl send "<text>"
|
|
85
|
+
ec ctl send --encrypt "<text>"
|
|
86
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ec rpc — 底层 AUN RPC 调用
|
|
2
|
+
|
|
3
|
+
直接调用 AUN 协议方法的逃生通道。触发词:直接调协议方法/批量 RPC。
|
|
4
|
+
|
|
5
|
+
> 常规消息收发用 `ec msg` / `ec group`,文件用 `ec storage`。`ec rpc` 是这些命令未覆盖到协议方法时的低层入口。
|
|
6
|
+
|
|
7
|
+
## 用法
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ec rpc --as <aid> --params <params>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- `--as <aid>` — 以哪个本地 AID 身份发起调用
|
|
14
|
+
- `--params` — 调用参数,自动判断输入形式:
|
|
15
|
+
- 单行 JSON(以 `{` 开头)→ 单次调用
|
|
16
|
+
- 多行 JSONL → 逐行执行,失败即停
|
|
17
|
+
- 文件路径(文件存在)→ 读取文件内容作为 JSONL
|
|
18
|
+
|
|
19
|
+
每行 JSON 格式:`{"method":"<namespace.method>","params":{...}}`
|
|
20
|
+
|
|
21
|
+
## 示例
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 单次调用
|
|
25
|
+
ec rpc --as alice.agentid.pub --params '{"method":"message.send","params":{"to":"bob.agentid.pub","payload":{"type":"text","text":"hello"}}}'
|
|
26
|
+
|
|
27
|
+
# 批量(从文件读 JSONL)
|
|
28
|
+
ec rpc --as alice.agentid.pub --params calls.jsonl
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
输出为每次调用的 JSON 结果(批量则逐行输出)。
|
|
32
|
+
|
|
33
|
+
## 命名空间速查
|
|
34
|
+
|
|
35
|
+
完整协议命名空间(auth/message/group/storage/stream/meta 等)见 `$KITS_DOCS/aun/CHEATSHEET.md`;完整协议文档 Read `$AUN_PROTOCOL_DOCS`。
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ec storage — 文件存储
|
|
2
|
+
|
|
3
|
+
AUN 网络上的文件存储:上传、下载、列举、删除、查配额。触发词:上传/下载/存文件/配额。
|
|
4
|
+
|
|
5
|
+
以自己的 AID 为操作者(`<aid>`)。
|
|
6
|
+
|
|
7
|
+
## 子命令
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# 上传文件(默认私有,--public 公开)
|
|
11
|
+
ec storage upload <aid> <local-file> <remote-path> [--public]
|
|
12
|
+
|
|
13
|
+
# 下载文件
|
|
14
|
+
ec storage download <aid> <url> [local-path]
|
|
15
|
+
|
|
16
|
+
# 列文件
|
|
17
|
+
ec storage ls <aid> [prefix]
|
|
18
|
+
|
|
19
|
+
# 删文件
|
|
20
|
+
ec storage rm <aid> <remote-path>
|
|
21
|
+
|
|
22
|
+
# 查配额
|
|
23
|
+
ec storage quota <aid>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## `<url>` 格式
|
|
27
|
+
|
|
28
|
+
`[https://]<owner-aid>/<path>` —— 下载可指向自己或他人的公开文件:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 下载自己的文件
|
|
32
|
+
ec storage download myaid.agentid.pub myaid.agentid.pub/notes/doc.txt ./doc.txt
|
|
33
|
+
|
|
34
|
+
# 下载他人的公开文件
|
|
35
|
+
ec storage download myaid.agentid.pub bob.agentid.pub/public/file.pdf ./file.pdf
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 示例
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
ec storage upload myaid.agentid.pub ./pic.png images/pic.png --public
|
|
42
|
+
ec storage ls myaid.agentid.pub notes/
|
|
43
|
+
ec storage rm myaid.agentid.pub notes/doc.txt
|
|
44
|
+
ec storage quota myaid.agentid.pub
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 通用约定
|
|
48
|
+
|
|
49
|
+
- `--format json` — 输出 JSON
|
package/kits/eck_manifest.json
CHANGED
|
@@ -4,76 +4,115 @@
|
|
|
4
4
|
{
|
|
5
5
|
"id": "rules",
|
|
6
6
|
"type": "directory",
|
|
7
|
-
"path": "$
|
|
7
|
+
"path": "$KITS_RULES",
|
|
8
8
|
"order": 10,
|
|
9
9
|
"needsInjection": false,
|
|
10
10
|
"when": "always",
|
|
11
|
-
"description": "ECK
|
|
11
|
+
"description": "ECK 核心规则(自动加载)"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"id": "identity-layer",
|
|
15
15
|
"type": "file",
|
|
16
|
-
"file": "$
|
|
16
|
+
"file": "$KITS_FRAGMENTS/identity.md",
|
|
17
17
|
"order": 20,
|
|
18
18
|
"needsInjection": true,
|
|
19
|
-
"when": {
|
|
20
|
-
"var": "chatType",
|
|
21
|
-
"neq": null
|
|
22
|
-
},
|
|
19
|
+
"when": { "var": "chatType", "neq": null },
|
|
23
20
|
"description": "身份层:我是谁"
|
|
24
21
|
},
|
|
22
|
+
{
|
|
23
|
+
"id": "persona",
|
|
24
|
+
"type": "file",
|
|
25
|
+
"file": "$PERSONAL_DIR/persona.md",
|
|
26
|
+
"order": 21,
|
|
27
|
+
"needsInjection": false,
|
|
28
|
+
"when": { "var": "chatType", "neq": null },
|
|
29
|
+
"description": "人格档案(persona.md)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "working-memory",
|
|
33
|
+
"type": "file",
|
|
34
|
+
"file": "$PERSONAL_DIR/memory/working.md",
|
|
35
|
+
"order": 22,
|
|
36
|
+
"needsInjection": false,
|
|
37
|
+
"when": { "var": "chatType", "neq": null },
|
|
38
|
+
"description": "当前关注(working memory)"
|
|
39
|
+
},
|
|
25
40
|
{
|
|
26
41
|
"id": "relation-layer",
|
|
27
42
|
"type": "file",
|
|
28
|
-
"file": "$
|
|
43
|
+
"file": "$KITS_FRAGMENTS/relation.md",
|
|
29
44
|
"order": 30,
|
|
30
45
|
"needsInjection": true,
|
|
31
|
-
"when": {
|
|
32
|
-
"var": "chatType",
|
|
33
|
-
"in": ["private", "group"]
|
|
34
|
-
},
|
|
46
|
+
"when": { "var": "chatType", "in": ["private", "group"] },
|
|
35
47
|
"description": "关系层:跟我聊天的是谁"
|
|
36
48
|
},
|
|
37
49
|
{
|
|
38
50
|
"id": "peer-profile",
|
|
39
51
|
"type": "file",
|
|
40
|
-
"file": "$
|
|
52
|
+
"file": "$RELATIONS_DIR/{{peerKey}}/profile.md",
|
|
41
53
|
"order": 35,
|
|
42
54
|
"needsInjection": false,
|
|
43
|
-
"when": {
|
|
44
|
-
"var": "peerKey",
|
|
45
|
-
"neq": null
|
|
46
|
-
},
|
|
55
|
+
"when": { "var": "peerKey", "neq": null },
|
|
47
56
|
"description": "当前对端的关系档案"
|
|
48
57
|
},
|
|
49
58
|
{
|
|
50
|
-
"id": "venue-
|
|
59
|
+
"id": "venue-fragment",
|
|
51
60
|
"type": "file",
|
|
52
|
-
"file": "$
|
|
61
|
+
"file": "$KITS_FRAGMENTS/venue.md",
|
|
53
62
|
"order": 40,
|
|
54
63
|
"needsInjection": true,
|
|
55
|
-
"when": {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
64
|
+
"when": { "var": "chatType", "neq": null },
|
|
65
|
+
"description": "环境层模板(基础参数)"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "venue-chattype",
|
|
69
|
+
"type": "file",
|
|
70
|
+
"file": "$KITS_DOCS/venues/{{chatType}}.md",
|
|
71
|
+
"order": 41,
|
|
72
|
+
"needsInjection": false,
|
|
73
|
+
"when": { "var": "chatType", "neq": null },
|
|
74
|
+
"description": "场景通用文档(private/group)"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "venue-channel-chattype",
|
|
78
|
+
"type": "file",
|
|
79
|
+
"file": "$KITS_DOCS/venues/{{channel}}-{{chatType}}.md",
|
|
80
|
+
"order": 42,
|
|
81
|
+
"needsInjection": false,
|
|
82
|
+
"when": { "var": "chatType", "neq": null },
|
|
83
|
+
"description": "渠道+场景文档(如 feishu-group)"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "venue-group-profile",
|
|
87
|
+
"type": "file",
|
|
88
|
+
"file": "$VENUES_DIR/{{channel}}#{{groupId}}/profile.md",
|
|
89
|
+
"order": 43,
|
|
90
|
+
"needsInjection": false,
|
|
91
|
+
"when": { "var": "groupId", "neq": null },
|
|
92
|
+
"description": "具体群环境文档"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "venue-client",
|
|
96
|
+
"type": "file",
|
|
97
|
+
"file": "$KITS_DOCS/venues/client-{{clientType}}.md",
|
|
98
|
+
"order": 44,
|
|
99
|
+
"needsInjection": false,
|
|
100
|
+
"when": { "var": "clientType", "neq": null },
|
|
101
|
+
"description": "客户端环境文档"
|
|
60
102
|
},
|
|
61
103
|
{
|
|
62
104
|
"id": "channel-layer",
|
|
63
105
|
"type": "file",
|
|
64
|
-
"file": "$
|
|
106
|
+
"file": "$KITS_FRAGMENTS/channel.md",
|
|
65
107
|
"order": 50,
|
|
66
108
|
"needsInjection": true,
|
|
67
|
-
"when": {
|
|
68
|
-
"var": "channel",
|
|
69
|
-
"neq": null
|
|
70
|
-
},
|
|
109
|
+
"when": { "var": "channel", "neq": null },
|
|
71
110
|
"description": "渠道层:通信渠道及能力"
|
|
72
111
|
},
|
|
73
112
|
{
|
|
74
113
|
"id": "session",
|
|
75
114
|
"type": "file",
|
|
76
|
-
"file": "$
|
|
115
|
+
"file": "$KITS_FRAGMENTS/session.md",
|
|
77
116
|
"order": 60,
|
|
78
117
|
"needsInjection": true,
|
|
79
118
|
"when": "always",
|
|
@@ -82,14 +121,11 @@
|
|
|
82
121
|
{
|
|
83
122
|
"id": "baseagent",
|
|
84
123
|
"type": "file",
|
|
85
|
-
"file": "$
|
|
124
|
+
"file": "$KITS_FRAGMENTS/baseagent.md",
|
|
86
125
|
"order": 70,
|
|
87
126
|
"needsInjection": true,
|
|
88
|
-
"when": {
|
|
89
|
-
"var": "baseAgent",
|
|
90
|
-
"neq": null
|
|
91
|
-
},
|
|
127
|
+
"when": { "var": "baseAgent", "neq": null },
|
|
92
128
|
"description": "Base Agent 特定配置"
|
|
93
129
|
}
|
|
94
130
|
]
|
|
95
|
-
}
|
|
131
|
+
}
|
|
@@ -57,7 +57,7 @@ AUN 把 agent 当网络主体(具备社会人属性:身份/通信/自主),
|
|
|
57
57
|
│ │
|
|
58
58
|
Evol 前端 EvolClaw
|
|
59
59
|
(App/Web/Desktop) Channel 适配层(AUN/飞书/微信/...)
|
|
60
|
-
或其它 AUN 客户端 关系层 / 环境层 /
|
|
60
|
+
或其它 AUN 客户端 身份层 / 关系层 / 环境层 / 渠道层 / 会话层
|
|
61
61
|
Base Agent(Claude Code / Codex / Gemini/...)
|
|
62
62
|
|
|
63
63
|
```
|
|
@@ -69,7 +69,7 @@ EvolClaw 是一个 Node.js 项目,通过 `npm install -g evolclaw@latest` 安
|
|
|
69
69
|
|
|
70
70
|
### Evol
|
|
71
71
|
|
|
72
|
-
Evol 是 AUN 原生的消息应用(App / Web / Desktop)——人和 agent 都是其中的主体。用户通过 Evol 与 agent
|
|
72
|
+
Evol 是 AUN 原生的消息应用(App / Web / Desktop)——人和 agent 都是其中的主体。用户通过 Evol 与 agent以及其他人对话。
|
|
73
73
|
|
|
74
74
|
### Channel
|
|
75
75
|
|
|
@@ -102,13 +102,24 @@ ECK(EvolClaw Context Kit)是 EvolClaw 的上下文组装系统。你正在
|
|
|
102
102
|
|
|
103
103
|
### 上下文组装流程
|
|
104
104
|
|
|
105
|
-
evolclaw
|
|
105
|
+
evolclaw 收到每条消息时,由一份**声明式 manifest** 决定加载哪些上下文段——不是写死的分支。
|
|
106
|
+
每个 section 带 `when` 条件,evolclaw 按当前会话构造一组运行时变量(`chatType`、`channel`、
|
|
107
|
+
`selfAid`、`peerKey` 等)逐段求值,命中的才按顺序拼进 system prompt(`needsInjection` 的段还会先做模板渲染)。
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
|
110
|
-
|
|
111
|
-
|
|
|
109
|
+
按场景,命中的段大致是:
|
|
110
|
+
|
|
111
|
+
| 场景 | 命中的层/段 |
|
|
112
|
+
|------|------------|
|
|
113
|
+
| coding(无渠道) | rules + 会话层 + baseagent(身份/关系/环境/渠道层因无 channel、无身份而落选) |
|
|
114
|
+
| private(私聊) | rules + 身份层 + 关系层(对端)+ 环境层 + 渠道层 + 会话层 + baseagent |
|
|
115
|
+
| group(群聊) | rules + 身份层 + 关系层(群)+ 环境层 + 渠道层 + 会话层 + baseagent |
|
|
116
|
+
|
|
117
|
+
> 会话层(session fragment)是 `when:always`、baseagent 段只要注入了 base agent 信息就加载——
|
|
118
|
+
> 二者与 chatType 无关,每个场景都在;所以 coding 并非"仅 rules"。
|
|
119
|
+
|
|
120
|
+
manifest schema、when 条件、合并覆盖、模板渲染、运行时变量目录,以及**实际渲染结果的调试输出**
|
|
121
|
+
(`$EVOLCLAW_HOME/data/eck-debug/` 下的 vars / context / fragments / manifest 四个文件):
|
|
122
|
+
详见 `$KITS_DOCS/context-assembly.md`。
|
|
112
123
|
|
|
113
124
|
## 术语
|
|
114
125
|
|
|
@@ -116,5 +127,4 @@ evolclaw 收到消息后,按场景决定加载哪些层:
|
|
|
116
127
|
- **对端**:和你通信的主体
|
|
117
128
|
- **本端(self)**:你自己
|
|
118
129
|
- **用户**:对端中的人类一方
|
|
119
|
-
- **环境(Venue)**:渠道 + 场景(私聊/群聊)构成的交互空间
|
|
120
|
-
|
|
130
|
+
- **环境(Venue)**:渠道 + 场景(私聊/群聊)构成的交互空间
|