evolcore 0.0.32 → 0.0.33
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 +24 -0
- package/bin/install-codex-managed-hooks.mjs +124 -37
- package/dist/agents/claude-runner.js +29 -2
- package/dist/agents/codex/app-server-client.js +3 -0
- package/dist/agents/codex/diagnostics.js +76 -44
- package/dist/agents/codex-runner.js +23 -19
- package/dist/agents/ecagent-runner.js +5 -13
- package/dist/aun/group/operations.js +0 -1
- package/dist/aun/msg/history.js +1 -0
- package/dist/aun/msg/p2p.js +0 -1
- package/dist/aun/outbox.js +50 -1
- package/dist/channels/aun.js +28 -2
- package/dist/channels/daemon.js +257 -2
- package/dist/cli/agent-command.js +58 -24
- package/dist/cli/agent.js +1 -1
- package/dist/cli/aun-commands.js +365 -29
- package/dist/cli/contact.js +8 -2
- package/dist/cli/daemon-commands.js +81 -12
- package/dist/cli/debug-mode.js +154 -0
- package/dist/cli/handoff-command.js +3 -0
- package/dist/cli/index.js +81 -64
- package/dist/cli/init.js +2 -2
- package/dist/cli/managed-command-guard.js +5 -0
- package/dist/cli/memory-command.js +8 -1
- package/dist/cli/queue-command.js +9 -4
- package/dist/cli/session-command.js +194 -0
- package/dist/cli/skill-command.js +78 -2
- package/dist/cli/task-context.js +1 -0
- package/dist/cli/thread-command.js +620 -0
- package/dist/cli/trigger-command.js +4 -2
- package/dist/config/builtin-roles.js +1 -0
- package/dist/config/config-field-policy.js +2 -3
- package/dist/config/config-manager.js +7 -2
- package/dist/config/resolved-config-op.js +3 -0
- package/dist/config-store.js +15 -0
- package/dist/core/auth/agent-delegation.js +25 -1
- package/dist/core/auth/debug-context.js +139 -0
- package/dist/core/auth/operation-authorizer.js +24 -1
- package/dist/core/auth/operation-catalog.js +33 -0
- package/dist/core/background-session/session-cleanup.js +212 -0
- package/dist/core/background-session/types.js +10 -0
- package/dist/core/bootstrap-messages.js +1 -1
- package/dist/core/bootstrap-service.js +6 -3
- package/dist/core/command/command-handler.js +60 -24
- package/dist/core/command/memory-slash.js +6 -2
- package/dist/core/command/menu-catalog.js +48 -1
- package/dist/core/command/menu-handler.js +92 -16
- package/dist/core/command/menu-protocol.js +24 -1
- package/dist/core/command/skill-slash.js +322 -0
- package/dist/core/command/slash-gate.js +6 -4
- package/dist/core/command/slash-handler.js +193 -13
- package/dist/core/command/topic-slash.js +528 -0
- package/dist/core/evolagent-registry.js +20 -5
- package/dist/core/handoff/runtime.js +5 -11
- package/dist/core/handoff/store.js +5 -0
- package/dist/core/ipc-registration.js +139 -2
- package/dist/core/memory/consolidation-context.js +49 -16
- package/dist/core/memory/consolidation-ops-records.js +35 -0
- package/dist/core/memory/consolidation-queue-format.js +21 -0
- package/dist/core/memory/consolidation.js +174 -180
- package/dist/core/message/aun-ipc-sender.js +161 -6
- package/dist/core/message/im-renderer.js +149 -6
- package/dist/core/message/message-bridge.js +13 -3
- package/dist/core/message/message-log.js +1 -0
- package/dist/core/message/peer-mode.js +6 -1
- package/dist/core/message/response-engine.js +349 -67
- package/dist/core/message/subtask-tool-projection.js +140 -0
- package/dist/core/model/catalog-service.js +17 -12
- package/dist/core/permission/ec-command-parser.js +126 -7
- package/dist/core/session/session-idle-monitor.js +249 -22
- package/dist/core/session/session-manager.js +54 -9
- package/dist/core/skill/command-parser.js +13 -0
- package/dist/core/skill/index-generator.js +4 -1
- package/dist/core/skill/startup.js +41 -0
- package/dist/core/skill/switch-resolver.js +55 -29
- package/dist/core/thread/command-parser.js +125 -0
- package/dist/core/thread/index.js +1 -0
- package/dist/core/thread/ipc-operation.js +95 -0
- package/dist/core/thread/thread-context-storage.js +131 -0
- package/dist/core/thread/thread-operation.js +258 -0
- package/dist/core/thread/thread-route.js +33 -0
- package/dist/core/thread/thread-service.js +777 -0
- package/dist/core/thread/types.js +1 -0
- package/dist/eck/message-renderer.js +35 -0
- package/dist/index.js +8 -5
- package/dist/ipc.js +89 -10
- package/dist/paths.js +23 -0
- package/dist/response-system/engines/v1/proactive-flow.js +169 -80
- package/dist/trigger/authorization.js +57 -28
- package/dist/trigger/feedback.js +7 -1
- package/dist/trigger/parser.js +63 -1
- package/dist/trigger/validation.js +14 -0
- package/dist/utils/error-utils.js +22 -1
- package/kits/docs/context-assembly.md +1 -0
- package/kits/docs/evolcore/INDEX.md +1 -0
- package/kits/docs/evolcore/agent-create.md +39 -28
- package/kits/docs/evolcore/agent.md +19 -4
- package/kits/docs/evolcore/ec-capabilities.md +4 -0
- package/kits/docs/evolcore/group-collaboration.md +3 -5
- package/kits/docs/evolcore/group.md +3 -4
- package/kits/docs/evolcore/memory-consolidation.md +1 -1
- package/kits/docs/evolcore/menu-exec-schema-commands.md +2 -2
- package/kits/docs/evolcore/menu-protocol.md +7 -0
- package/kits/docs/evolcore/msg.md +5 -8
- package/kits/docs/evolcore/thread-chain.md +267 -0
- package/kits/docs/prompt-loading-architecture.md +1 -0
- package/kits/eck_manifest.json +61 -26
- package/kits/eck_message_manifest.json +169 -10
- package/kits/rules/05-venue.md +1 -1
- package/kits/rules/07-memory-and-thread.md +202 -0
- package/kits/schemas/relation-config.schema.9.json +18 -3
- package/kits/schemas/role-config.schema.1.json +6 -6
- package/kits/schemas/single-session.schema.1.json +6 -6
- package/kits/schemas/single-session.schema.2.json +6 -6
- package/kits/schemas/single-session.schema.3.json +6 -6
- package/kits/skills/.switches.json +12 -1
- package/kits/skills/ec-group/SKILL.md +234 -0
- package/kits/skills/ec-skill/SKILL.md +10 -1
- package/kits/skills/ec-skill/scripts/cli.mjs +15 -1
- package/kits/skills/scrapling-article-fetch/SKILL.md +128 -0
- package/kits/skills/scrapling-article-fetch/scripts/check_python_env.py +54 -0
- package/kits/skills/scrapling-article-fetch/scripts/render_markdown_reply.py +35 -0
- package/kits/skills/scrapling-article-fetch/scripts/run_pipeline.sh +16 -0
- package/kits/skills/scrapling-article-fetch/scripts/scrapling_fetch.py +344 -0
- package/kits/skills/thread-ops/SKILL.md +492 -0
- package/kits/skills/wechat-article-media-download/SKILL.md +65 -0
- package/kits/skills/wechat-article-media-download/scripts/download.py +163 -0
- package/kits/skills/wechat-article-reader/SKILL.md +97 -0
- package/kits/skills/wechat-article-reader/scripts/fetch.mjs +256 -0
- package/kits/templates/bootstrap-welcome.md +7 -7
- package/kits/templates/memory-consolidation/forget.md +5 -0
- package/kits/templates/memory-consolidation/generalize.md +5 -0
- package/kits/templates/memory-consolidation/profile.md +5 -0
- package/kits/templates/memory-consolidation/promote.md +5 -0
- package/kits/templates/message-fragments/item.md +2 -1
- package/kits/templates/message-fragments/thread-context.md +6 -0
- package/kits/templates/message-fragments/trigger-session.md +2 -0
- package/kits/templates/message-fragments/trigger-thread-check.md +2 -0
- package/kits/templates/roles/member.json +2 -0
- package/kits/templates/roles/visitor.json +2 -0
- package/kits/templates/system-fragments/bootstrap.md +66 -72
- package/kits/templates/system-fragments/channel.md +3 -6
- package/kits/templates/system-fragments/commands.md +1 -0
- package/kits/templates/system-fragments/managed-runtime.md +15 -0
- package/kits/templates/system-fragments/reply.md +3 -2
- package/kits/templates/system-fragments/session.md +5 -14
- package/package.json +3 -1
- package/kits/docs/evolcore/group-fs.md +0 -17
- package/kits/docs/venues/aun-group.md +0 -45
- package/kits/docs/venues/group.md +0 -43
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# ec thread — 话题链命令
|
|
2
|
+
|
|
3
|
+
话题(Thread)是在私聊或群聊关系里切出的独立对话分支。一组对话可以同时推进多个话题,每个话题有自己的上下文、历史和生命周期,互不干扰。话题链(Thread Chain)则是跨会话、跨 agent 的协作机制:A 可以把一条任务"分支"到 B 的某个话题,B 也可以在自己的话题里继续工作,两者通过 `ec msg send --thread` 和 thread-inbox 上下文注入关联起来。
|
|
4
|
+
|
|
5
|
+
触发词:话题/thread/跨会话/委托/ec thread/话题链/summary/删除话题/thread-inbox/跨会话上下文。
|
|
6
|
+
|
|
7
|
+
## 标准工作流
|
|
8
|
+
|
|
9
|
+
话题是对端级别的操作,先找到 agent 和对端,再操作话题:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# 第一步:列出本机所有 agent(找到目标 selfAid)
|
|
13
|
+
ec agent list
|
|
14
|
+
|
|
15
|
+
# 第二步:列出该 agent 有话题记录的所有对端
|
|
16
|
+
ec thread peers --self <selfAid>
|
|
17
|
+
|
|
18
|
+
# 第三步:列出与某对端的所有话题(默认每页10条)
|
|
19
|
+
ec thread list <peer> --self <selfAid>
|
|
20
|
+
|
|
21
|
+
# 第四步:翻页(页脚会给出完整翻页命令)
|
|
22
|
+
ec thread list <peer> --self <selfAid> --page 2 --limit 10 --sort recent
|
|
23
|
+
|
|
24
|
+
# 第五步:查看某话题的历史消息
|
|
25
|
+
ec thread history <peer>/<threadId> --self <selfAid> --limit 20
|
|
26
|
+
|
|
27
|
+
# 第六步:查看/写入 summary
|
|
28
|
+
ec thread summary show <peer>/<threadId> --self <selfAid>
|
|
29
|
+
# 写入时必须带 --name(同时设标题);不想改名传 -(详见「话题摘要」一节)
|
|
30
|
+
ec thread summary set <peer>/<threadId> "摘要内容" --name "<新标题>" --self <selfAid>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 什么时候用
|
|
34
|
+
|
|
35
|
+
- 同一对端有多条并行任务线(项目 A、项目 B 分开管理)
|
|
36
|
+
- 跨 agent 委托:A 向 B 发起一个话题,B 接收后在自己的话题里处理
|
|
37
|
+
- 需要给某段对话贴标签、跟踪状态(pending / in_progress / completed / archived)
|
|
38
|
+
- 想保存话题摘要(summary),供下次激活时快速恢复上下文
|
|
39
|
+
- 整理完成或废弃的话题时(删除话题)
|
|
40
|
+
|
|
41
|
+
主会话(主对话,无 threadId)不能删除。话题是主会话之外额外创建的分支。
|
|
42
|
+
|
|
43
|
+
## 基础操作
|
|
44
|
+
|
|
45
|
+
### 列出话题
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ec thread peers # 列出该 agent 有话题的所有对端
|
|
49
|
+
ec thread list <peer>
|
|
50
|
+
ec thread list <peer> --status in_progress
|
|
51
|
+
ec thread list <peer> --label 项目A
|
|
52
|
+
ec thread list <peer> --unlabeled
|
|
53
|
+
ec thread list <peer> --sort recent --limit 20
|
|
54
|
+
ec thread list <peer> --format json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`ec thread list` 必须带 `<peer>` 参数,不带 peer 会报错并提示用 `ec thread peers` 查找对端。每条话题显示消息(24h/总计)统计、最后一条消息截断(50字)和当前摘要(未设置时显示"未总结")。
|
|
58
|
+
|
|
59
|
+
### 查看话题详情
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
ec thread show <peer>/<threadId>
|
|
63
|
+
ec thread show current # 当前任务所在话题
|
|
64
|
+
ec thread show <peer> # 该对端的主会话
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 读取话题历史消息
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
ec thread history <peer>/<threadId>
|
|
71
|
+
ec thread history <peer>/<threadId> --limit 100
|
|
72
|
+
ec thread history <peer>/<threadId> --after 1700000000000
|
|
73
|
+
ec thread history <peer>/<threadId> --before 1700000000000
|
|
74
|
+
ec thread history <peer>/<threadId> --format json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
托管会话中可以直接用 `ec msg history --thread <id>`,from/to 会自动从运行时上下文推断:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
ec msg history --thread <threadId>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`ec thread history` 是推荐用法。
|
|
84
|
+
|
|
85
|
+
### 新建话题
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
ec thread create <peer> --name "项目A需求讨论"
|
|
89
|
+
ec thread create <peer> --name "项目A" --label 项目A --status in_progress
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
创建成功后返回 `threadId`,格式为 `thread-<ms>-<seq4>-<rand4>`(如 `thread-1791028341906-0000-136a`)。创建时会自动向对端发一条系统消息通知。
|
|
93
|
+
|
|
94
|
+
### 修改话题
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
ec thread rename <peer>/<threadId> "新名称"
|
|
98
|
+
ec thread label <peer>/<threadId> 重要
|
|
99
|
+
ec thread label <peer>/<threadId> --clear # 清除标签
|
|
100
|
+
ec thread status <peer>/<threadId> completed # pending|in_progress|completed|archived
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`/name` 和 `/rename` 也会同步更新话题索引。
|
|
104
|
+
|
|
105
|
+
### 删除话题
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
ec thread delete <peer>/<threadId> # 软删除:session 文件移入 _trash/,索引条目删除
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
删除后话题从索引中消失,`ec thread list` 不再显示。底层 session 文件通过 `unbindSession` 机制移入 `chatDir/_trash/`,与系统其他删除行为一致。不能删除正在处理中(busy)的话题,也不能删除主会话。
|
|
112
|
+
|
|
113
|
+
删除时会自动取消该话题的所有关联 Trigger,防止 ghost wakeup。
|
|
114
|
+
|
|
115
|
+
删除后历史仍可通过 `ec thread history <peer>/<threadId>` 读取(直接读 messages.jsonl,不依赖索引)。
|
|
116
|
+
|
|
117
|
+
## 跨会话发送(话题链核心)
|
|
118
|
+
|
|
119
|
+
在托管会话中,`ec msg send` 支持 `--thread` 参数直接路由到某个话题:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# 完整形式
|
|
123
|
+
ec msg send <from> <to> "消息内容" --thread <threadId>
|
|
124
|
+
|
|
125
|
+
# 托管会话简化形式(from/to 自动从运行时上下文推断)
|
|
126
|
+
ec msg send "消息内容" --thread <threadId>
|
|
127
|
+
|
|
128
|
+
# 附带复查 Trigger(跨话题时必填;每 30m 唤醒本端回查)
|
|
129
|
+
ec msg send "消息内容" --thread <threadId> --check-every 30m
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
注意事项:
|
|
133
|
+
|
|
134
|
+
- `--thread` 指定的话题必须已存在于本端索引(`ec thread list` 可见),否则返回 `TOPIC_NOT_FOUND`
|
|
135
|
+
- **跨话题发送时 `--check-every` 为必填项**,不指定会直接报错。取值如 `5m` / `30m` / `2h` / `1d`
|
|
136
|
+
- 跨话题发送成功后,系统会在**本端**写一条 thread-inbox 记录。目标话题下次被唤醒时,
|
|
137
|
+
这条记录会以「⟵ 跨会话上下文 · 来源话题:xxx」的形式注入一次,然后删除
|
|
138
|
+
- `--check-every` 会创建周期复查 Trigger(名称 `check-<目标>-from-<来源>-<唯一后缀>`,`kind=thread-check`),
|
|
139
|
+
每隔指定时长唤醒本端话题,提示回查目标话题与来源话题,直到显式
|
|
140
|
+
`ec trigger cancel <triggerId>` 结束。**每次发送都新建一个 Trigger**,取消/调整用
|
|
141
|
+
返回的 `trigger_id`(形如 `trig_…`)——`ec trigger` 的定位标识是 **id 不是名称**
|
|
142
|
+
- `--trigger-prompt "<text>"` 可选,用于替换复查 prompt 中的自定义段(默认给出通用的检查/决策指引)
|
|
143
|
+
|
|
144
|
+
### 跨会话委托的完整流程
|
|
145
|
+
|
|
146
|
+
**A 委托 B 处理某个任务:**
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# A 向 B 的话题 T2 发送任务,并设置周期复查
|
|
150
|
+
ec msg send "请处理项目A的数据清洗" --thread thread-T2-xxxx --check-every 2h
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**B 接收时感知来源上下文:**
|
|
154
|
+
|
|
155
|
+
B 的目标话题下次被唤醒时,prompt 开头会注入一条跨会话上下文,格式如下:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
‹跨会话上下文 · 来源话题:thread-T1-xxxx · 对端:alice.agentid.cn · 发送于:2026-10-10 10:00›
|
|
159
|
+
⚠️ 来源话题在发送后已有 3 条新消息(10:01 - 10:15)—— 处理前建议先回查该话题的空洞期消息。
|
|
160
|
+
🔔 复查 Trigger:trig_1791765199642_5371c8ff(尚未触发/待处理)
|
|
161
|
+
【原消息内容】
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
注入只发生一次。之后 B 靠自身上下文记住"我从哪个话题跨过来的",可随时用
|
|
165
|
+
`ec thread history <来源peer>/<来源话题>` 回查空洞期消息。
|
|
166
|
+
|
|
167
|
+
## 话题摘要(Summary)
|
|
168
|
+
|
|
169
|
+
摘要用于跨会话保留话题的核心信息,在下次激活或委托时快速恢复上下文。
|
|
170
|
+
daemon 不自动总结,需要 agent 主动写入。
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# 查看当前摘要(同时打印 coveredThroughTs 覆盖游标)
|
|
174
|
+
ec thread summary show <peer>/<threadId>
|
|
175
|
+
|
|
176
|
+
# 写入摘要 —— --name 必填:同时把话题改成这个标题
|
|
177
|
+
ec thread summary set <peer>/<threadId> "项目A需求已确认,正在开发登录模块" --name "项目A登录模块"
|
|
178
|
+
# 不想改话题名就显式传 -
|
|
179
|
+
ec thread summary set <peer>/<threadId> "摘要内容" --name -
|
|
180
|
+
|
|
181
|
+
# 支持 CAS(乐观锁),防止并发覆盖
|
|
182
|
+
ec thread summary set <peer>/<threadId> "新内容" --name - --if-rev 3
|
|
183
|
+
|
|
184
|
+
# 查看历史版本
|
|
185
|
+
ec thread summary log <peer>/<threadId>
|
|
186
|
+
|
|
187
|
+
# 清空当前摘要(历史版本保留)
|
|
188
|
+
ec thread summary clear <peer>/<threadId>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### 覆盖游标与增量总结
|
|
192
|
+
|
|
193
|
+
`summary set` 会在写入时自动记录 `coveredThroughTs`——**当时该话题最后一条消息的时间戳**,
|
|
194
|
+
表示"这条摘要覆盖到哪"。`summary show` 会把它打印出来。
|
|
195
|
+
|
|
196
|
+
下次总结时用它作起点,只读增量(不必拍脑袋定 `--limit`):
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# 1. 拿覆盖游标
|
|
200
|
+
ec thread summary show <peer>/<threadId> # 输出中的 coveredThroughTs
|
|
201
|
+
|
|
202
|
+
# 2. 读游标之后的增量(首次总结无游标时省略 --after,全量读)
|
|
203
|
+
ec thread history <peer>/<threadId> --after <coveredThroughTs> --limit 50
|
|
204
|
+
|
|
205
|
+
# 3. 增量较多时往回翻页(history 支持 before 逆序分页)
|
|
206
|
+
ec thread history <peer>/<threadId> --before <本页最早一条的ts> --limit 50
|
|
207
|
+
|
|
208
|
+
# 4. 读完增量后写摘要,游标自动推进到当前最新一条
|
|
209
|
+
ec thread summary set <peer>/<threadId> "新摘要" --name -
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**约束**:`summary set` 把游标设为**写入时刻话题的最新一条**,所以跨话题总结必须**先把增量读完再写**——
|
|
213
|
+
没读完就写,游标会越过未读的那段,它们下次不会再被返回。
|
|
214
|
+
|
|
215
|
+
存储位置:`~/.evolcore/agents/<selfAid>/data/threads/summaries/<sessionId>.summary.jsonl`。
|
|
216
|
+
|
|
217
|
+
CAS 说明:`--if-rev <n>` 指定当前已知的版本号;若实际版本不匹配,写入失败并返回 `SUMMARY_CAS_CONFLICT`。先用 `show` 拿到当前 rev,再带上 `--if-rev` 写入,可防止并发覆盖。
|
|
218
|
+
|
|
219
|
+
## 重建索引
|
|
220
|
+
|
|
221
|
+
话题索引损坏或和 session 文件不同步时,可以重建。
|
|
222
|
+
|
|
223
|
+
索引与摘要、跨会话收件箱统一收在 `~/.evolcore/agents/<selfAid>/data/threads/` 下:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
data/threads/
|
|
227
|
+
├── index.json 话题索引
|
|
228
|
+
├── summaries/ 话题摘要(<sessionId>.summary.jsonl)
|
|
229
|
+
└── inbox/ 跨会话上下文收件箱
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
ec thread rebuild-index
|
|
234
|
+
ec thread rebuild-index --agent <aid> # 跨身份操作
|
|
235
|
+
ec thread rebuild-index --check # 只检查不写盘
|
|
236
|
+
ec thread check-index # 同 rebuild-index --check
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## 引用格式(\<ref\>)
|
|
240
|
+
|
|
241
|
+
命令里的 `<ref>` 参数支持三种格式:
|
|
242
|
+
|
|
243
|
+
| 格式 | 含义 |
|
|
244
|
+
|---|---|
|
|
245
|
+
| `current` | 当前任务所在话题 |
|
|
246
|
+
| `<peer>` | 该对端的主会话 |
|
|
247
|
+
| `<peer>/<threadId>` | 指定话题,如 `bob.agentid.cn/thread-xxx-0001-aaaa` |
|
|
248
|
+
|
|
249
|
+
## 话题状态值
|
|
250
|
+
|
|
251
|
+
| 值 | 含义 |
|
|
252
|
+
|---|---|
|
|
253
|
+
| `pending` | 待开始(默认) |
|
|
254
|
+
| `in_progress` | 进行中 |
|
|
255
|
+
| `completed` | 已完成 |
|
|
256
|
+
| `archived` | 已归档 |
|
|
257
|
+
|
|
258
|
+
## 常见错误码
|
|
259
|
+
|
|
260
|
+
| 错误码 | 含义 | 处理建议 |
|
|
261
|
+
|---|---|---|
|
|
262
|
+
| `TOPIC_NOT_FOUND` | 话题不存在或 threadId 错误 | 用 `ec thread list <peer>` 确认 threadId |
|
|
263
|
+
| `TOPIC_CONFLICT` | 同名话题已存在 | 改名或用现有话题 |
|
|
264
|
+
| `TOPIC_BUSY` | 话题正在处理中 | 等待处理完成后再删除 |
|
|
265
|
+
| `SUMMARY_CAS_CONFLICT` | 摘要版本冲突 | 重新 `show` 获取最新 rev,再重试 |
|
|
266
|
+
| `INVALID_NAME` | 话题名称不合法 | 名称不能为空,不超过 80 字符 |
|
|
267
|
+
| `NAME_TOO_LONG` | 话题名称超过 80 字符 | 缩短名称 |
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
| 55 | commands | channel≠null | ✓ | 命令集能力卡 |
|
|
118
118
|
| 60 | session | always | ✓ | 会话层 fragment(含 localDate/weekday) |
|
|
119
119
|
| 70 | baseagent | baseAgent≠null | ✓ | base agent 配置 fragment |
|
|
120
|
+
| 80 | managed-runtime-notice | lifecycle=active | ✓ | 托管运行时提示(勿重复读 $KITS_RULES/ 与 CLAUDE.md 指令) |
|
|
120
121
|
|
|
121
122
|
### 输出结构
|
|
122
123
|
|
package/kits/eck_manifest.json
CHANGED
|
@@ -45,6 +45,32 @@
|
|
|
45
45
|
},
|
|
46
46
|
"description": "身份层:我是谁"
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
"id": "skills-builtin",
|
|
50
|
+
"type": "file",
|
|
51
|
+
"file": "$AGENT_DIR/skills/.index-builtin.md",
|
|
52
|
+
"order": 20.5,
|
|
53
|
+
"needsInjection": false,
|
|
54
|
+
"optional": true,
|
|
55
|
+
"when": {
|
|
56
|
+
"var": "lifecycle",
|
|
57
|
+
"eq": "active"
|
|
58
|
+
},
|
|
59
|
+
"description": "内置技能索引"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "skills-local",
|
|
63
|
+
"type": "file",
|
|
64
|
+
"file": "$AGENT_DIR/skills/.index-local.md",
|
|
65
|
+
"order": 20.6,
|
|
66
|
+
"needsInjection": false,
|
|
67
|
+
"optional": true,
|
|
68
|
+
"when": {
|
|
69
|
+
"var": "lifecycle",
|
|
70
|
+
"eq": "active"
|
|
71
|
+
},
|
|
72
|
+
"description": "本机技能索引"
|
|
73
|
+
},
|
|
48
74
|
{
|
|
49
75
|
"id": "persona",
|
|
50
76
|
"type": "file",
|
|
@@ -85,32 +111,6 @@
|
|
|
85
111
|
},
|
|
86
112
|
"description": "个人资料(personal.md)"
|
|
87
113
|
},
|
|
88
|
-
{
|
|
89
|
-
"id": "skills-builtin",
|
|
90
|
-
"type": "file",
|
|
91
|
-
"file": "$AGENT_DIR/skills/.index-builtin.md",
|
|
92
|
-
"order": 20.5,
|
|
93
|
-
"needsInjection": false,
|
|
94
|
-
"optional": true,
|
|
95
|
-
"when": {
|
|
96
|
-
"var": "lifecycle",
|
|
97
|
-
"eq": "active"
|
|
98
|
-
},
|
|
99
|
-
"description": "内置技能索引"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"id": "skills-local",
|
|
103
|
-
"type": "file",
|
|
104
|
-
"file": "$AGENT_DIR/skills/.index-local.md",
|
|
105
|
-
"order": 20.6,
|
|
106
|
-
"needsInjection": false,
|
|
107
|
-
"optional": true,
|
|
108
|
-
"when": {
|
|
109
|
-
"var": "lifecycle",
|
|
110
|
-
"eq": "active"
|
|
111
|
-
},
|
|
112
|
-
"description": "本机技能索引"
|
|
113
|
-
},
|
|
114
114
|
{
|
|
115
115
|
"id": "relation-layer",
|
|
116
116
|
"type": "file",
|
|
@@ -346,6 +346,29 @@
|
|
|
346
346
|
},
|
|
347
347
|
"description": "客户端环境文档"
|
|
348
348
|
},
|
|
349
|
+
{
|
|
350
|
+
"id": "memory-and-thread",
|
|
351
|
+
"type": "file",
|
|
352
|
+
"file": "$KITS_RULES/07-memory-and-thread.md",
|
|
353
|
+
"order": 46,
|
|
354
|
+
"needsInjection": false,
|
|
355
|
+
"when": {
|
|
356
|
+
"and": [
|
|
357
|
+
{
|
|
358
|
+
"var": "chatType",
|
|
359
|
+
"in": [
|
|
360
|
+
"private",
|
|
361
|
+
"group"
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"var": "lifecycle",
|
|
366
|
+
"eq": "active"
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
"description": "记忆与话题:持久化上下文的两套机制(memory + thread)"
|
|
371
|
+
},
|
|
349
372
|
{
|
|
350
373
|
"id": "reply-contract",
|
|
351
374
|
"type": "file",
|
|
@@ -440,6 +463,18 @@
|
|
|
440
463
|
]
|
|
441
464
|
},
|
|
442
465
|
"description": "Base Agent 特定配置"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"id": "managed-runtime-notice",
|
|
469
|
+
"type": "file",
|
|
470
|
+
"file": "$KITS_FRAGMENTS/managed-runtime.md",
|
|
471
|
+
"order": 80,
|
|
472
|
+
"needsInjection": true,
|
|
473
|
+
"when": {
|
|
474
|
+
"var": "lifecycle",
|
|
475
|
+
"eq": "active"
|
|
476
|
+
},
|
|
477
|
+
"description": "托管运行时提示:上下文已就绪,勿重复读取"
|
|
443
478
|
}
|
|
444
479
|
]
|
|
445
480
|
}
|
|
@@ -10,7 +10,18 @@
|
|
|
10
10
|
"modeType": "inject",
|
|
11
11
|
"modeName": "default",
|
|
12
12
|
"isDefault": true,
|
|
13
|
-
"when": {
|
|
13
|
+
"when": {
|
|
14
|
+
"and": [
|
|
15
|
+
{
|
|
16
|
+
"var": "isOwnerHint",
|
|
17
|
+
"eq": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"var": "renderMode_inject",
|
|
21
|
+
"eq": "default"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
14
25
|
"description": "观察者插话提示渲染(owner 信封头·default 模式)"
|
|
15
26
|
},
|
|
16
27
|
{
|
|
@@ -21,8 +32,23 @@
|
|
|
21
32
|
"needsInjection": true,
|
|
22
33
|
"modeType": "handoff",
|
|
23
34
|
"modeName": "request_to_target",
|
|
24
|
-
"when": {
|
|
25
|
-
|
|
35
|
+
"when": {
|
|
36
|
+
"and": [
|
|
37
|
+
{
|
|
38
|
+
"var": "isHandoff",
|
|
39
|
+
"eq": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"var": "handoffKind",
|
|
43
|
+
"eq": "request_to_target"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"var": "handoffReturnPolicy",
|
|
47
|
+
"eq": "required"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"description": "[DEPRECATED] msg send 跨会话请求回复上下文渲染(handoff 已被 Thread Context 取代,见 docs/thread-chain/handoff-deprecation.md)"
|
|
26
52
|
},
|
|
27
53
|
{
|
|
28
54
|
"id": "msg-handoff-context-to-target",
|
|
@@ -32,8 +58,23 @@
|
|
|
32
58
|
"needsInjection": true,
|
|
33
59
|
"modeType": "handoff",
|
|
34
60
|
"modeName": "request_to_target",
|
|
35
|
-
"when": {
|
|
36
|
-
|
|
61
|
+
"when": {
|
|
62
|
+
"and": [
|
|
63
|
+
{
|
|
64
|
+
"var": "isHandoff",
|
|
65
|
+
"eq": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"var": "handoffKind",
|
|
69
|
+
"eq": "request_to_target"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"var": "handoffReturnPolicy",
|
|
73
|
+
"eq": "none"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"description": "[DEPRECATED] msg send 跨会话单次本地上下文渲染(handoff 已被 Thread Context 取代,见 docs/thread-chain/handoff-deprecation.md)"
|
|
37
78
|
},
|
|
38
79
|
{
|
|
39
80
|
"id": "msg-handoff-response-to-origin",
|
|
@@ -43,8 +84,80 @@
|
|
|
43
84
|
"needsInjection": true,
|
|
44
85
|
"modeType": "handoff",
|
|
45
86
|
"modeName": "response_to_origin",
|
|
46
|
-
"when": {
|
|
47
|
-
|
|
87
|
+
"when": {
|
|
88
|
+
"and": [
|
|
89
|
+
{
|
|
90
|
+
"var": "isHandoff",
|
|
91
|
+
"eq": true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"var": "handoffKind",
|
|
95
|
+
"eq": "response_to_origin"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"description": "[DEPRECATED] msg send 跨会话结果回流上下文渲染(handoff 已被 Thread Context 取代,见 docs/thread-chain/handoff-deprecation.md)"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "msg-trigger-thread-check",
|
|
103
|
+
"type": "file",
|
|
104
|
+
"file": "$KITS_MESSAGE_FRAGMENTS/trigger-thread-check.md",
|
|
105
|
+
"order": 5,
|
|
106
|
+
"needsInjection": true,
|
|
107
|
+
"modeType": "trigger-thread-check",
|
|
108
|
+
"modeName": "default",
|
|
109
|
+
"isDefault": true,
|
|
110
|
+
"when": {
|
|
111
|
+
"and": [
|
|
112
|
+
{
|
|
113
|
+
"var": "isTriggerMsg",
|
|
114
|
+
"eq": true
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"var": "triggerMsgKind",
|
|
118
|
+
"eq": "thread-check"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"description": "跨话题复查 Trigger 专属渲染(kind=thread-check:来源话题 + 目标话题 + 周期)"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "msg-trigger-session",
|
|
126
|
+
"type": "file",
|
|
127
|
+
"file": "$KITS_MESSAGE_FRAGMENTS/trigger-session.md",
|
|
128
|
+
"order": 6,
|
|
129
|
+
"needsInjection": true,
|
|
130
|
+
"modeType": "trigger-session",
|
|
131
|
+
"modeName": "default",
|
|
132
|
+
"isDefault": true,
|
|
133
|
+
"when": {
|
|
134
|
+
"and": [
|
|
135
|
+
{
|
|
136
|
+
"var": "isTriggerMsg",
|
|
137
|
+
"eq": true
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"var": "triggerMsgKind",
|
|
141
|
+
"neq": "thread-check"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"description": "Trigger 唤醒消息渲染(trigger 信封头 + 触发时间 + 正文)"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "msg-thread-context",
|
|
149
|
+
"type": "file",
|
|
150
|
+
"file": "$KITS_MESSAGE_FRAGMENTS/thread-context.md",
|
|
151
|
+
"order": 8,
|
|
152
|
+
"needsInjection": true,
|
|
153
|
+
"modeType": "thread-context",
|
|
154
|
+
"modeName": "default",
|
|
155
|
+
"isDefault": true,
|
|
156
|
+
"when": {
|
|
157
|
+
"var": "isThreadContext",
|
|
158
|
+
"eq": true
|
|
159
|
+
},
|
|
160
|
+
"description": "跨会话上下文注入(来源话题 + 空洞提示 + 复查 Trigger)"
|
|
48
161
|
},
|
|
49
162
|
{
|
|
50
163
|
"id": "msg-private-default",
|
|
@@ -55,7 +168,30 @@
|
|
|
55
168
|
"modeType": "private",
|
|
56
169
|
"modeName": "default",
|
|
57
170
|
"isDefault": true,
|
|
58
|
-
"when": {
|
|
171
|
+
"when": {
|
|
172
|
+
"and": [
|
|
173
|
+
{
|
|
174
|
+
"var": "isOwnerHint",
|
|
175
|
+
"neq": true
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"var": "isThreadContext",
|
|
179
|
+
"neq": true
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"var": "isTriggerMsg",
|
|
183
|
+
"neq": true
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"var": "chatType",
|
|
187
|
+
"neq": "group"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"var": "renderMode_private",
|
|
191
|
+
"eq": "default"
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
},
|
|
59
195
|
"description": "对端私聊消息渲染(default 模式;chatType 非 group 的非插话消息,含 handoff/coding/null 兜底)"
|
|
60
196
|
},
|
|
61
197
|
{
|
|
@@ -67,8 +203,31 @@
|
|
|
67
203
|
"modeType": "group",
|
|
68
204
|
"modeName": "default",
|
|
69
205
|
"isDefault": true,
|
|
70
|
-
"when": {
|
|
206
|
+
"when": {
|
|
207
|
+
"and": [
|
|
208
|
+
{
|
|
209
|
+
"var": "isOwnerHint",
|
|
210
|
+
"neq": true
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"var": "isThreadContext",
|
|
214
|
+
"neq": true
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"var": "isTriggerMsg",
|
|
218
|
+
"neq": true
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"var": "chatType",
|
|
222
|
+
"eq": "group"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"var": "renderMode_group",
|
|
226
|
+
"eq": "default"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
71
230
|
"description": "群聊消息渲染(default 模式)"
|
|
72
231
|
}
|
|
73
232
|
]
|
|
74
|
-
}
|
|
233
|
+
}
|
package/kits/rules/05-venue.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
| 位置 | 内容 |
|
|
31
31
|
|------|------|
|
|
32
|
-
| `$KITS_DOCS/venues/` | 环境层场景文档(只读,按需加载):`private.md`
|
|
32
|
+
| `$KITS_DOCS/venues/` | 环境层场景文档(只读,按需加载):`private.md` `<channel>-<chatType>.md` `client-*.md`。群聊场景的完整指引已抽离为内置技能 `ec-group`,不再有 `venues/group.md` |
|
|
33
33
|
| `$VENUES_DIR`(`$AGENT_DIR/venues/`) | **目前是死目录**:会被创建(含 `_index/` `_trash/`),但源码里 `agentVenuesDir()` 零调用点,无人读写 |
|
|
34
34
|
|
|
35
35
|
> `venues/` 下若有 `aun#<group-aid>` 之类的实例目录,是已删除模块 `group-venue-sync.ts` 的历史残留,
|