evolcore 0.0.2 → 0.0.4

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.
Files changed (206) hide show
  1. package/CHANGELOG.md +93 -778
  2. package/README.md +45 -10
  3. package/bin/ec-safe-output.js +89 -24
  4. package/dist/agents/baseagent.js +46 -0
  5. package/dist/agents/claude-runner.js +198 -48
  6. package/dist/agents/codex-app-server-client.js +68 -0
  7. package/dist/agents/codex-runner.js +203 -8
  8. package/dist/agents/runner-types.js +2 -2
  9. package/dist/aun/aid/agentmd.js +79 -0
  10. package/dist/aun/aid/encryption-seed-policy.js +29 -0
  11. package/dist/aun/aid/index.js +1 -1
  12. package/dist/aun/aid/store.js +2 -5
  13. package/dist/aun/outbox.js +8 -0
  14. package/dist/channels/aun.js +241 -116
  15. package/dist/channels/daemon.js +18 -4
  16. package/dist/channels/dingtalk.js +1005 -260
  17. package/dist/channels/feishu.js +184 -56
  18. package/dist/channels/qqbot.js +23 -1
  19. package/dist/channels/wechat.js +303 -155
  20. package/dist/channels/wecom.js +1132 -164
  21. package/dist/cli/agent-command.js +2 -1
  22. package/dist/cli/aun-commands.js +98 -43
  23. package/dist/cli/bench.js +2 -2
  24. package/dist/cli/contact.js +71 -0
  25. package/dist/cli/ctl-command.js +2 -2
  26. package/dist/cli/daemon-commands.js +77 -214
  27. package/dist/cli/handoff-command.js +4 -3
  28. package/dist/cli/help.js +9 -5
  29. package/dist/cli/index.js +132 -116
  30. package/dist/cli/init-channel.js +242 -129
  31. package/dist/cli/init.js +70 -31
  32. package/dist/cli/model.js +2 -1
  33. package/dist/cli/net-check.js +2 -2
  34. package/dist/cli/queue-command.js +30 -6
  35. package/dist/cli/raw-key-input.js +25 -0
  36. package/dist/cli/response.js +5 -6
  37. package/dist/cli/restart-monitor.js +25 -1
  38. package/dist/cli/stats.js +6 -4
  39. package/dist/cli/trigger-command.js +146 -25
  40. package/dist/cli/version.js +6 -1
  41. package/dist/config/access-policy-domain.js +38 -0
  42. package/dist/config/access-policy.js +134 -0
  43. package/dist/config/builtin-role-templates.js +42 -17
  44. package/dist/config/builtin-roles.js +31 -6
  45. package/dist/config/config-field-policy.js +17 -5
  46. package/dist/config/config-manager.js +409 -29
  47. package/dist/config/config-operation-service.js +35 -38
  48. package/dist/config/contact-alias.js +68 -0
  49. package/dist/config/contact-bind-code.js +274 -0
  50. package/dist/config/contact-book-store.js +622 -0
  51. package/dist/config/contact-book-v2-startup.js +35 -0
  52. package/dist/config/contact-book.js +185 -300
  53. package/dist/config/contact-operation-service.js +116 -0
  54. package/dist/config/contact-request-service.js +331 -0
  55. package/dist/config/peer-role-resolver.js +136 -55
  56. package/dist/config/role-ranks.js +18 -0
  57. package/dist/config/role-service.js +16 -19
  58. package/dist/config/role-store.js +16 -5
  59. package/dist/config/roles.js +10 -1
  60. package/dist/config/schema-registry.js +49 -24
  61. package/dist/config-store.js +14 -4
  62. package/dist/core/auth/agent-delegation.js +105 -11
  63. package/dist/core/auth/authorization-audit.js +16 -1
  64. package/dist/core/auth/operation-authorizer.js +10 -0
  65. package/dist/core/auth/operation-catalog.js +105 -1
  66. package/dist/core/auth/trigger-authorization.js +15 -0
  67. package/dist/core/bootstrap-service.js +2 -9
  68. package/dist/core/channel-loader.js +6 -2
  69. package/dist/core/command/command-handler.js +113 -21
  70. package/dist/core/command/connect-menu.js +599 -0
  71. package/dist/core/command/evol-menu-version-gate.js +38 -0
  72. package/dist/core/command/group-menu.js +421 -0
  73. package/dist/core/command/menu-handler.js +382 -100
  74. package/dist/core/command/menu-protocol.js +8 -2
  75. package/dist/core/command/menu-token-store.js +102 -0
  76. package/dist/core/command/role-menu.js +128 -29
  77. package/dist/core/command/slash-gate.js +1 -1
  78. package/dist/core/command/slash-handler.js +186 -49
  79. package/dist/core/daemon-file-cache.js +40 -6
  80. package/dist/core/event-catalog.js +99 -0
  81. package/dist/core/evolagent-registry.js +4 -40
  82. package/dist/core/evolagent.js +20 -9
  83. package/dist/core/handoff/runtime.js +162 -37
  84. package/dist/core/handoff/store.js +46 -2
  85. package/dist/core/handoff/types.js +1 -0
  86. package/dist/core/inference/text-inference.js +16 -74
  87. package/dist/core/message/file-markers.js +7 -0
  88. package/dist/core/message/im-renderer.js +20 -14
  89. package/dist/core/message/inbound-admission.js +124 -0
  90. package/dist/core/message/message-bridge.js +670 -57
  91. package/dist/core/message/message-log.js +1 -0
  92. package/dist/core/message/message-queue.js +195 -10
  93. package/dist/core/message/message-utils.js +8 -2
  94. package/dist/core/message/peer-mode.js +7 -8
  95. package/dist/core/message/response-engine.js +642 -96
  96. package/dist/core/message/send-receipt.js +24 -0
  97. package/dist/core/message/stream-debouncer.js +11 -2
  98. package/dist/core/permission/approval-gateway.js +17 -10
  99. package/dist/core/permission/ec-command-parser.js +101 -46
  100. package/dist/core/permission/tool-policy.js +115 -38
  101. package/dist/core/protected-paths.js +38 -11
  102. package/dist/core/session/session-fs-store.js +44 -3
  103. package/dist/core/session/session-manager.js +86 -8
  104. package/dist/core/session/session-mapper.js +2 -0
  105. package/dist/core/session/session-renew.js +125 -69
  106. package/dist/core/session/session-turn-coordinator.js +5 -1
  107. package/dist/eck/kit-renderer.js +12 -1
  108. package/dist/eck/message-renderer.js +79 -1
  109. package/dist/index.js +285 -94
  110. package/dist/ipc.js +114 -8
  111. package/dist/paths.js +3 -0
  112. package/dist/response-system/config-resolver.js +29 -0
  113. package/dist/response-system/coordinator.js +8 -32
  114. package/dist/response-system/engines/v1/proactive-flow.js +1 -1
  115. package/dist/response-system/index.js +1 -0
  116. package/dist/response-system/modes/single-session/index.js +7 -4
  117. package/dist/stats/billing.js +20 -8
  118. package/dist/trigger/manager.js +3 -0
  119. package/dist/trigger/parser.js +126 -11
  120. package/dist/trigger/patch.js +12 -2
  121. package/dist/trigger/scheduler.js +444 -40
  122. package/dist/trigger/validation.js +13 -0
  123. package/dist/utils/aid-bind.js +43 -29
  124. package/dist/utils/error-dict.json +7 -0
  125. package/dist/utils/evolcore-version.js +21 -0
  126. package/dist/utils/instance-registry.js +14 -7
  127. package/dist/utils/log-writer.js +46 -0
  128. package/dist/utils/logger.js +2 -2
  129. package/dist/utils/media-cache.js +4 -1
  130. package/dist/utils/model-prices.jsonl +6 -3
  131. package/dist/utils/restart-safety.js +31 -0
  132. package/dist/utils/stable-semver.js +21 -0
  133. package/dist/utils/stats.js +33 -9
  134. package/dist/utils/system-memory.js +62 -0
  135. package/kits/docs/INDEX.md +2 -1
  136. package/kits/docs/channels/aun.md +4 -13
  137. package/kits/docs/evolcore/INDEX.md +5 -3
  138. package/kits/docs/evolcore/agent.md +9 -1
  139. package/kits/docs/evolcore/aid.md +5 -2
  140. package/kits/docs/evolcore/config.md +47 -2
  141. package/kits/docs/evolcore/contact.md +61 -0
  142. package/kits/docs/evolcore/fs.md +9 -0
  143. package/kits/docs/evolcore/group-rules.md +46 -4
  144. package/kits/docs/evolcore/group.md +15 -6
  145. package/kits/docs/evolcore/model.md +4 -1
  146. package/kits/docs/evolcore/msg.md +12 -6
  147. package/kits/docs/evolcore/response.md +16 -21
  148. package/kits/docs/evolcore/rpc.md +2 -0
  149. package/kits/docs/evolcore/stats.md +15 -2
  150. package/kits/docs/evolcore/storage.md +1 -0
  151. package/kits/docs/evolcore/trigger.md +42 -10
  152. package/kits/docs/path-registry.md +36 -17
  153. package/kits/eck_manifest.json +12 -0
  154. package/kits/eck_message_manifest.json +12 -1
  155. package/kits/migrations/migrate-contact-book-v2.mjs +754 -0
  156. package/kits/rules/01-overview.md +17 -7
  157. package/kits/rules/02-navigation.md +38 -18
  158. package/kits/rules/03-identity.md +28 -24
  159. package/kits/rules/04-relation.md +44 -28
  160. package/kits/rules/05-venue.md +31 -15
  161. package/kits/rules/06-channel.md +11 -7
  162. package/kits/schemas/_meta.json +21 -7
  163. package/kits/schemas/agent-config.schema.6.json +322 -0
  164. package/kits/schemas/agent-config.schema.7.json +303 -0
  165. package/kits/schemas/agent-config.schema.8.json +304 -0
  166. package/kits/schemas/agent-config.schema.9.json +374 -0
  167. package/kits/schemas/contact-book.schema.2.json +43 -0
  168. package/kits/schemas/contact-book.schema.3.json +67 -0
  169. package/kits/schemas/daemon.schema.1.json +3 -2
  170. package/kits/schemas/daemon.schema.2.json +101 -0
  171. package/kits/schemas/daemon.schema.3.json +123 -0
  172. package/kits/schemas/defaults.schema.2.json +85 -0
  173. package/kits/schemas/defaults.schema.3.json +73 -0
  174. package/kits/schemas/relation-config.schema.5.json +47 -0
  175. package/kits/schemas/relation-config.schema.6.json +46 -0
  176. package/kits/schemas/relation-config.schema.7.json +59 -0
  177. package/kits/schemas/role-config.schema.1.json +1 -0
  178. package/kits/schemas/role-registry.schema.1.json +2 -2
  179. package/kits/schemas/single-session.schema.2.json +57 -0
  180. package/kits/templates/message-fragments/handoff-context-to-target.md +9 -0
  181. package/kits/templates/message-fragments/handoff-request-to-target.md +14 -8
  182. package/kits/templates/message-fragments/handoff-response-to-origin.md +5 -6
  183. package/kits/templates/roles/admin.json +47 -0
  184. package/kits/templates/roles/member.json +5 -0
  185. package/kits/templates/roles/owner.json +1 -0
  186. package/kits/templates/roles/visitor.json +5 -0
  187. package/kits/templates/system-fragments/channel.md +12 -2
  188. package/kits/templates/system-fragments/commands.md +3 -1
  189. package/kits/templates/system-fragments/identity.md +3 -1
  190. package/kits/templates/system-fragments/relation.md +1 -1
  191. package/kits/templates/system-fragments/session.md +6 -2
  192. package/package.json +7 -5
  193. package/MIGRATION-0.5.0.md +0 -378
  194. package/ROLE_ACCESS_CONTROL.md +0 -174
  195. package/assets/brand/evolcore/README.md +0 -19
  196. package/assets/brand/evolcore/evolcore-app-icon.png +0 -0
  197. package/assets/brand/evolcore/evolcore-app-icon.svg +0 -13
  198. package/assets/brand/evolcore/evolcore-brand-board.png +0 -0
  199. package/assets/brand/evolcore/evolcore-brand-board.svg +0 -126
  200. package/assets/brand/evolcore/evolcore-logo-kit.zip +0 -0
  201. package/assets/brand/evolcore/evolcore-logo-reverse.png +0 -0
  202. package/assets/brand/evolcore/evolcore-logo-reverse.svg +0 -14
  203. package/assets/brand/evolcore/evolcore-logo.png +0 -0
  204. package/assets/brand/evolcore/evolcore-logo.svg +0 -14
  205. package/assets/brand/evolcore/evolcore-mark.png +0 -0
  206. package/assets/brand/evolcore/evolcore-mark.svg +0 -10
@@ -0,0 +1,322 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "agent-config.schema.6.json",
4
+ "title": "AgentConfig v6 (agents/{aid}/config.json)",
5
+ "description": "Agent v6 主配置。owner 保留为安全锚点,admin 已迁移到 AUN 私聊 relation。",
6
+ "x-logical-name": "agent-config",
7
+ "x-scope": "agent",
8
+ "type": "object",
9
+ "additionalProperties": true,
10
+ "not": {
11
+ "description": "禁止旧权限字段和已迁移到 relation role 的 admins。",
12
+ "anyOf": [
13
+ {
14
+ "description": "禁止旧版顶层 permissionMode;权限模式由独立角色策略决定。",
15
+ "required": [
16
+ "permissionMode"
17
+ ]
18
+ },
19
+ {
20
+ "description": "禁止旧版内嵌 roles;角色定义和默认角色已迁移到独立 roles/ 配置域。",
21
+ "required": [
22
+ "roles"
23
+ ]
24
+ },
25
+ {
26
+ "description": "admin 关系身份由 AUN 私聊 relation role 管理。",
27
+ "required": [
28
+ "admins"
29
+ ]
30
+ }
31
+ ]
32
+ },
33
+ "required": [
34
+ "aid",
35
+ "channels"
36
+ ],
37
+ "properties": {
38
+ "$schema_version": {
39
+ "type": "number",
40
+ "const": 6,
41
+ "default": 6,
42
+ "x-merge": "scalar",
43
+ "description": "配置 Schema 版本;v6 将 admin 身份移入 AUN 私聊 relation"
44
+ },
45
+ "aid": {
46
+ "type": "string",
47
+ "x-merge": "scalar",
48
+ "description": "Agent 的全局唯一身份标识"
49
+ },
50
+ "enabled": {
51
+ "type": "boolean",
52
+ "default": true,
53
+ "x-merge": "scalar",
54
+ "description": "是否启用 Agent;缺省按启用处理"
55
+ },
56
+ "lifecycle": {
57
+ "type": "string",
58
+ "enum": [
59
+ "created",
60
+ "bootstrapping",
61
+ "active"
62
+ ],
63
+ "x-merge": "scalar",
64
+ "description": "agent 生命周期状态",
65
+ "x-enumDescriptions": {
66
+ "created": "已创建,尚未进入引导流程",
67
+ "bootstrapping": "引导中(初始化配置/身份)",
68
+ "active": "已激活,正常运行"
69
+ }
70
+ },
71
+ "initialized": {
72
+ "type": "boolean",
73
+ "x-merge": "scalar",
74
+ "description": "是否已完成 Agent 初始化流程"
75
+ },
76
+ "owners": {
77
+ "type": "array",
78
+ "items": {
79
+ "type": "string",
80
+ "description": "一个 Agent owner 的身份标识,通常为 AID。"
81
+ },
82
+ "uniqueItems": true,
83
+ "x-merge": "list",
84
+ "description": "Agent 所有者身份列表;用于 owner 级控制和通知"
85
+ },
86
+ "channels": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "object",
90
+ "description": "一个渠道实例配置;具体字段由渠道类型及其适配器定义。"
91
+ },
92
+ "x-merge": "list",
93
+ "description": "Agent 绑定的消息渠道实例列表"
94
+ },
95
+ "aun": {
96
+ "type": "object",
97
+ "x-merge": "dict",
98
+ "description": "Agent 级 AUN 通信配置"
99
+ },
100
+ "models": {
101
+ "type": "object",
102
+ "x-merge": "dict",
103
+ "description": "Agent 级模型别名、注册表或模型覆盖配置"
104
+ },
105
+ "active_baseagent": {
106
+ "type": "string",
107
+ "x-merge": "scalar",
108
+ "description": "默认使用的 base agent 标识,例如 claude 或 codex"
109
+ },
110
+ "baseagents": {
111
+ "type": "object",
112
+ "x-merge": "dict",
113
+ "description": "各 base agent 的模型、推理强度及运行参数"
114
+ },
115
+ "projects": {
116
+ "type": "object",
117
+ "x-merge": "dict",
118
+ "description": "Agent 可用项目路径和项目选择配置"
119
+ },
120
+ "capabilities": {
121
+ "type": "object",
122
+ "x-merge": "dict",
123
+ "description": "Agent 能力开关及能力参数"
124
+ },
125
+ "debug": {
126
+ "type": "object",
127
+ "x-merge": "dict",
128
+ "description": "Agent 级调试和诊断配置"
129
+ },
130
+ "observable": {
131
+ "type": "boolean",
132
+ "default": false,
133
+ "x-merge": "scalar",
134
+ "description": "是否将 Agent 的入站和出站消息转发给 owners;默认关闭"
135
+ },
136
+ "chatmode": {
137
+ "type": "object",
138
+ "x-merge": "dict",
139
+ "default": {
140
+ "private": "interactive",
141
+ "group": "proactive",
142
+ "nothuman": "proactive"
143
+ },
144
+ "properties": {
145
+ "private": {
146
+ "enum": [
147
+ "interactive",
148
+ "proactive"
149
+ ],
150
+ "description": "人类私聊场景的投递方式",
151
+ "x-enumDescriptions": {
152
+ "interactive": "同步交互:输出即回复",
153
+ "proactive": "主动推送:CLI 回复 + 思考投影"
154
+ }
155
+ },
156
+ "group": {
157
+ "enum": [
158
+ "interactive",
159
+ "proactive"
160
+ ],
161
+ "description": "群聊场景的投递方式",
162
+ "x-enumDescriptions": {
163
+ "interactive": "同步交互:输出即回复",
164
+ "proactive": "主动推送:CLI 回复 + 思考投影"
165
+ }
166
+ },
167
+ "nothuman": {
168
+ "enum": [
169
+ "interactive",
170
+ "proactive"
171
+ ],
172
+ "description": "非人类(agent)私聊场景的投递方式",
173
+ "x-enumDescriptions": {
174
+ "interactive": "同步交互:输出即回复",
175
+ "proactive": "主动推送:CLI 回复 + 思考投影"
176
+ }
177
+ }
178
+ },
179
+ "additionalProperties": false,
180
+ "description": "chatmode 场景默认表;出厂默认值即此 default(agent 级改默认,关系级按键覆盖)。键封闭 private/group/nothuman,值枚举 interactive/proactive"
181
+ },
182
+ "mentionMode": {
183
+ "type": "string",
184
+ "enum": [
185
+ "disabled",
186
+ "mention-only"
187
+ ],
188
+ "default": "disabled",
189
+ "x-merge": "scalar",
190
+ "description": "@ 处理策略(顶层通用参数)",
191
+ "x-enumDescriptions": {
192
+ "disabled": "处理所有消息",
193
+ "mention-only": "只处理被 @ 的消息,未 @ 作引用上下文"
194
+ }
195
+ },
196
+ "model": {
197
+ "type": "string",
198
+ "x-merge": "scalar",
199
+ "description": "主会话模型(顶层通用参数);无默认值,缺省时由响应模式/全局默认决定"
200
+ },
201
+ "responseMode": {
202
+ "type": "string",
203
+ "x-merge": "scalar",
204
+ "description": "响应模式 id(标量);候选清单/默认值来自注册表,非 schema。关系级>agent级>注册表首选"
205
+ },
206
+ "responseModeParams": {
207
+ "type": "object",
208
+ "x-merge": "dict",
209
+ "description": "响应模式特有参数字典,按模式 id 分桶:{ [modeId]: {...} }"
210
+ },
211
+ "flush_delay": {
212
+ "type": "number",
213
+ "minimum": 0,
214
+ "default": 3,
215
+ "x-merge": "scalar",
216
+ "description": "流式出站消息的批量刷新间隔,单位为秒;默认 3 秒"
217
+ },
218
+ "debounce": {
219
+ "type": "number",
220
+ "minimum": 0,
221
+ "default": 0,
222
+ "x-merge": "scalar",
223
+ "description": "入站消息合并窗口,单位为秒;0 表示不合并,默认 0"
224
+ },
225
+ "show_activities": {
226
+ "type": "string",
227
+ "enum": [
228
+ "all",
229
+ "text",
230
+ "none"
231
+ ],
232
+ "default": "all",
233
+ "x-merge": "scalar",
234
+ "description": "中间输出展示范围(仅对 interactive 私聊有意义)",
235
+ "x-enumDescriptions": {
236
+ "all": "文本 + activity",
237
+ "text": "仅文本",
238
+ "none": "全部静默"
239
+ }
240
+ },
241
+ "session_renew": {
242
+ "type": "object",
243
+ "x-merge": "dict",
244
+ "additionalProperties": false,
245
+ "description": "会话超时后的续接判定",
246
+ "properties": {
247
+ "enabled": {
248
+ "type": "boolean",
249
+ "default": false,
250
+ "description": "是否启用超时后的会话连续性判定"
251
+ },
252
+ "after_hours": {
253
+ "type": "number",
254
+ "exclusiveMinimum": 0,
255
+ "default": 24,
256
+ "description": "距最后一条有效对话超过该小时数才触发判定"
257
+ },
258
+ "effort": {
259
+ "type": "string",
260
+ "enum": [
261
+ "low",
262
+ "medium",
263
+ "high",
264
+ "xhigh",
265
+ "max"
266
+ ],
267
+ "default": "low",
268
+ "description": "续接判定的推理强度",
269
+ "x-enumDescriptions": {
270
+ "low": "低",
271
+ "medium": "中",
272
+ "high": "高",
273
+ "xhigh": "很高",
274
+ "max": "最高"
275
+ }
276
+ },
277
+ "fallback_action": {
278
+ "type": "string",
279
+ "enum": [
280
+ "continue",
281
+ "new"
282
+ ],
283
+ "default": "continue",
284
+ "description": "无法判定时的兜底动作",
285
+ "x-enumDescriptions": {
286
+ "continue": "继续沿用当前会话",
287
+ "new": "开启新会话"
288
+ }
289
+ }
290
+ }
291
+ },
292
+ "group_venue_sync": {
293
+ "type": "object",
294
+ "x-merge": "dict",
295
+ "description": "AUN 群资源同步配置;控制规则文件路径、资源索引路径、条目/字节限制及刷新间隔。"
296
+ },
297
+ "render": {
298
+ "type": "object",
299
+ "x-merge": "dict",
300
+ "description": "私聊、群聊及注入内容使用的渲染器标识配置。"
301
+ },
302
+ "sessionManifests": {
303
+ "type": "object",
304
+ "x-merge": "dict",
305
+ "description": "会话类型到 manifest 文件的映射,用于选择对应的系统提示词清单。"
306
+ },
307
+ "enable_rich_content": {
308
+ "type": "boolean",
309
+ "x-merge": "scalar",
310
+ "description": "是否允许渠道使用富内容消息;未设置时由渠道能力和运行时默认决定"
311
+ },
312
+ "extra_backup": {
313
+ "type": "array",
314
+ "items": {
315
+ "type": "object",
316
+ "description": "一个额外备份规则,包含相对 path 和可选的文件匹配 pattern。"
317
+ },
318
+ "x-merge": "list",
319
+ "description": "配置快照需要额外包含的文件声明;不得指向 .env。"
320
+ }
321
+ }
322
+ }
@@ -0,0 +1,303 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "agent-config.schema.7.json",
4
+ "title": "AgentConfig v7 (agents/{aid}/config.json)",
5
+ "description": "Agent v7 主配置。Session Renew 的模型参数迁入响应模式桶。",
6
+ "x-logical-name": "agent-config",
7
+ "x-scope": "agent",
8
+ "type": "object",
9
+ "additionalProperties": true,
10
+ "not": {
11
+ "description": "禁止旧权限字段和已迁移到 relation role 的 admins。",
12
+ "anyOf": [
13
+ {
14
+ "description": "禁止旧版顶层 permissionMode;权限模式由独立角色策略决定。",
15
+ "required": [
16
+ "permissionMode"
17
+ ]
18
+ },
19
+ {
20
+ "description": "禁止旧版内嵌 roles;角色定义和默认角色已迁移到独立 roles/ 配置域。",
21
+ "required": [
22
+ "roles"
23
+ ]
24
+ },
25
+ {
26
+ "description": "admin 关系身份由 AUN 私聊 relation role 管理。",
27
+ "required": [
28
+ "admins"
29
+ ]
30
+ }
31
+ ]
32
+ },
33
+ "required": [
34
+ "aid",
35
+ "channels"
36
+ ],
37
+ "properties": {
38
+ "$schema_version": {
39
+ "type": "number",
40
+ "const": 7,
41
+ "default": 7,
42
+ "x-merge": "scalar",
43
+ "description": "配置 Schema 版本;v7 将 Session Renew 的模型参数移入响应模式桶"
44
+ },
45
+ "aid": {
46
+ "type": "string",
47
+ "x-merge": "scalar",
48
+ "description": "Agent 的全局唯一身份标识"
49
+ },
50
+ "enabled": {
51
+ "type": "boolean",
52
+ "default": true,
53
+ "x-merge": "scalar",
54
+ "description": "是否启用 Agent;缺省按启用处理"
55
+ },
56
+ "lifecycle": {
57
+ "type": "string",
58
+ "enum": [
59
+ "created",
60
+ "bootstrapping",
61
+ "active"
62
+ ],
63
+ "x-merge": "scalar",
64
+ "description": "agent 生命周期状态",
65
+ "x-enumDescriptions": {
66
+ "created": "已创建,尚未进入引导流程",
67
+ "bootstrapping": "引导中(初始化配置/身份)",
68
+ "active": "已激活,正常运行"
69
+ }
70
+ },
71
+ "initialized": {
72
+ "type": "boolean",
73
+ "x-merge": "scalar",
74
+ "description": "是否已完成 Agent 初始化流程"
75
+ },
76
+ "owners": {
77
+ "type": "array",
78
+ "items": {
79
+ "type": "string",
80
+ "description": "一个 Agent owner 的身份标识,通常为 AID。"
81
+ },
82
+ "uniqueItems": true,
83
+ "x-merge": "list",
84
+ "description": "Agent 所有者身份列表;用于 owner 级控制和通知"
85
+ },
86
+ "channels": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "object",
90
+ "description": "一个渠道实例配置;具体字段由渠道类型及其适配器定义。"
91
+ },
92
+ "x-merge": "list",
93
+ "description": "Agent 绑定的消息渠道实例列表"
94
+ },
95
+ "aun": {
96
+ "type": "object",
97
+ "x-merge": "dict",
98
+ "description": "Agent 级 AUN 通信配置"
99
+ },
100
+ "models": {
101
+ "type": "object",
102
+ "x-merge": "dict",
103
+ "description": "Agent 级模型别名、注册表或模型覆盖配置"
104
+ },
105
+ "active_baseagent": {
106
+ "type": "string",
107
+ "x-merge": "scalar",
108
+ "description": "默认使用的 base agent 标识,例如 claude 或 codex"
109
+ },
110
+ "baseagents": {
111
+ "type": "object",
112
+ "x-merge": "dict",
113
+ "description": "各 base agent 的模型、推理强度及运行参数"
114
+ },
115
+ "projects": {
116
+ "type": "object",
117
+ "x-merge": "dict",
118
+ "description": "Agent 可用项目路径和项目选择配置"
119
+ },
120
+ "capabilities": {
121
+ "type": "object",
122
+ "x-merge": "dict",
123
+ "description": "Agent 能力开关及能力参数"
124
+ },
125
+ "debug": {
126
+ "type": "object",
127
+ "x-merge": "dict",
128
+ "description": "Agent 级调试和诊断配置"
129
+ },
130
+ "observable": {
131
+ "type": "boolean",
132
+ "default": false,
133
+ "x-merge": "scalar",
134
+ "description": "是否将 Agent 的入站和出站消息转发给 owners;默认关闭"
135
+ },
136
+ "chatmode": {
137
+ "type": "object",
138
+ "x-merge": "dict",
139
+ "default": {
140
+ "private": "interactive",
141
+ "group": "proactive",
142
+ "nothuman": "proactive"
143
+ },
144
+ "properties": {
145
+ "private": {
146
+ "enum": [
147
+ "interactive",
148
+ "proactive"
149
+ ],
150
+ "description": "人类私聊场景的投递方式",
151
+ "x-enumDescriptions": {
152
+ "interactive": "同步交互:输出即回复",
153
+ "proactive": "主动推送:CLI 回复 + 思考投影"
154
+ }
155
+ },
156
+ "group": {
157
+ "enum": [
158
+ "interactive",
159
+ "proactive"
160
+ ],
161
+ "description": "群聊场景的投递方式",
162
+ "x-enumDescriptions": {
163
+ "interactive": "同步交互:输出即回复",
164
+ "proactive": "主动推送:CLI 回复 + 思考投影"
165
+ }
166
+ },
167
+ "nothuman": {
168
+ "enum": [
169
+ "interactive",
170
+ "proactive"
171
+ ],
172
+ "description": "非人类(agent)私聊场景的投递方式",
173
+ "x-enumDescriptions": {
174
+ "interactive": "同步交互:输出即回复",
175
+ "proactive": "主动推送:CLI 回复 + 思考投影"
176
+ }
177
+ }
178
+ },
179
+ "additionalProperties": false,
180
+ "description": "chatmode 场景默认表;出厂默认值即此 default(agent 级改默认,关系级按键覆盖)。键封闭 private/group/nothuman,值枚举 interactive/proactive"
181
+ },
182
+ "mentionMode": {
183
+ "type": "string",
184
+ "enum": [
185
+ "disabled",
186
+ "mention-only"
187
+ ],
188
+ "default": "disabled",
189
+ "x-merge": "scalar",
190
+ "description": "@ 处理策略(顶层通用参数)",
191
+ "x-enumDescriptions": {
192
+ "disabled": "处理所有消息",
193
+ "mention-only": "只处理被 @ 的消息,未 @ 作引用上下文"
194
+ }
195
+ },
196
+ "model": {
197
+ "type": "string",
198
+ "x-merge": "scalar",
199
+ "description": "主会话模型(顶层通用参数);无默认值,缺省时由响应模式/全局默认决定"
200
+ },
201
+ "responseMode": {
202
+ "type": "string",
203
+ "x-merge": "scalar",
204
+ "description": "响应模式 id(标量);候选清单/默认值来自注册表,非 schema。关系级>agent级>注册表首选"
205
+ },
206
+ "responseModeParams": {
207
+ "type": "object",
208
+ "x-merge": "dict",
209
+ "description": "响应模式特有参数字典,按模式 id 分桶:{ [modeId]: {...} }"
210
+ },
211
+ "flush_delay": {
212
+ "type": "number",
213
+ "minimum": 0,
214
+ "default": 3,
215
+ "x-merge": "scalar",
216
+ "description": "流式出站消息的批量刷新间隔,单位为秒;默认 3 秒"
217
+ },
218
+ "debounce": {
219
+ "type": "number",
220
+ "minimum": 0,
221
+ "default": 0,
222
+ "x-merge": "scalar",
223
+ "description": "入站消息合并窗口,单位为秒;0 表示不合并,默认 0"
224
+ },
225
+ "show_activities": {
226
+ "type": "string",
227
+ "enum": [
228
+ "all",
229
+ "text",
230
+ "none"
231
+ ],
232
+ "default": "all",
233
+ "x-merge": "scalar",
234
+ "description": "中间输出展示范围(仅对 interactive 私聊有意义)",
235
+ "x-enumDescriptions": {
236
+ "all": "文本 + activity",
237
+ "text": "仅文本",
238
+ "none": "全部静默"
239
+ }
240
+ },
241
+ "session_renew": {
242
+ "type": "object",
243
+ "x-merge": "dict",
244
+ "additionalProperties": false,
245
+ "description": "会话超时后的续接判定",
246
+ "properties": {
247
+ "enabled": {
248
+ "type": "boolean",
249
+ "default": false,
250
+ "description": "是否启用超时后的会话连续性判定"
251
+ },
252
+ "after_hours": {
253
+ "type": "number",
254
+ "exclusiveMinimum": 0,
255
+ "default": 24,
256
+ "description": "距最后一条有效对话超过该小时数才触发判定"
257
+ },
258
+ "fallback_action": {
259
+ "type": "string",
260
+ "enum": [
261
+ "continue",
262
+ "new"
263
+ ],
264
+ "default": "continue",
265
+ "description": "无法判定时的兜底动作",
266
+ "x-enumDescriptions": {
267
+ "continue": "继续沿用当前会话",
268
+ "new": "开启新会话"
269
+ }
270
+ }
271
+ }
272
+ },
273
+ "group_venue_sync": {
274
+ "type": "object",
275
+ "x-merge": "dict",
276
+ "description": "AUN 群资源同步配置;控制规则文件路径、资源索引路径、条目/字节限制及刷新间隔。"
277
+ },
278
+ "render": {
279
+ "type": "object",
280
+ "x-merge": "dict",
281
+ "description": "私聊、群聊及注入内容使用的渲染器标识配置。"
282
+ },
283
+ "sessionManifests": {
284
+ "type": "object",
285
+ "x-merge": "dict",
286
+ "description": "会话类型到 manifest 文件的映射,用于选择对应的系统提示词清单。"
287
+ },
288
+ "enable_rich_content": {
289
+ "type": "boolean",
290
+ "x-merge": "scalar",
291
+ "description": "是否允许渠道使用富内容消息;未设置时由渠道能力和运行时默认决定"
292
+ },
293
+ "extra_backup": {
294
+ "type": "array",
295
+ "items": {
296
+ "type": "object",
297
+ "description": "一个额外备份规则,包含相对 path 和可选的文件匹配 pattern。"
298
+ },
299
+ "x-merge": "list",
300
+ "description": "配置快照需要额外包含的文件声明;不得指向 .env。"
301
+ }
302
+ }
303
+ }