evolcore 0.0.40 → 0.0.41-test.1

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 (226) hide show
  1. package/CHANGELOG.md +94 -1
  2. package/bin/codex-managed-hook.mjs +11 -0
  3. package/bin/ec-safe-output.js +11 -1
  4. package/dist/agents/baseagent-availability.js +1 -1
  5. package/dist/agents/baseagent.js +20 -43
  6. package/dist/agents/claude-runner.js +197 -197
  7. package/dist/agents/codex-runner.js +535 -259
  8. package/dist/agents/ecagent-runner.js +31 -12
  9. package/dist/agents/gemini-runner.js +27 -7
  10. package/dist/agents/runner-types.js +11 -3
  11. package/dist/aun/ability-device-routing.js +26 -0
  12. package/dist/aun/aid/client.js +1 -1
  13. package/dist/aun/group/fs-download.js +39 -0
  14. package/dist/aun/group/identity.js +36 -13
  15. package/dist/aun/group/operations.js +5 -0
  16. package/dist/aun/msg/managed-operation.js +72 -11
  17. package/dist/aun/msg/p2p.js +32 -7
  18. package/dist/aun/service-proxy.js +36 -12
  19. package/dist/aun/storage/download.js +30 -0
  20. package/dist/aun/storage/index.js +14 -6
  21. package/dist/channels/aun.js +367 -24
  22. package/dist/channels/daemon.js +39 -5
  23. package/dist/cli/agent-command.js +2 -0
  24. package/dist/cli/agent-create.js +98 -19
  25. package/dist/cli/agent.js +10 -3
  26. package/dist/cli/aun-commands.js +85 -41
  27. package/dist/cli/daemon-commands.js +678 -688
  28. package/dist/cli/fs-command.js +64 -2
  29. package/dist/cli/index.js +48 -4
  30. package/dist/cli/managed-command-guard.js +4 -0
  31. package/dist/cli/model.js +40 -40
  32. package/dist/cli/proxy-command.js +92 -0
  33. package/dist/cli/restart-monitor.js +17 -0
  34. package/dist/cli/role.js +85 -0
  35. package/dist/cli/session-command.js +128 -13
  36. package/dist/cli/stats.js +60 -4
  37. package/dist/cli/trigger-command.js +2 -2
  38. package/dist/config/access-policy.js +8 -1
  39. package/dist/config/boot-log.js +38 -1
  40. package/dist/config/config-field-policy.js +5 -32
  41. package/dist/config/config-manager.js +46 -39
  42. package/dist/config/config-operation-service.js +8 -11
  43. package/dist/config/contact-book-store.js +47 -21
  44. package/dist/config/contact-book.js +18 -12
  45. package/dist/config/contact-operation-service.js +3 -4
  46. package/dist/config/contact-request-service.js +11 -0
  47. package/dist/config/daemon-services.js +11 -0
  48. package/dist/config/gateway-config.js +89 -595
  49. package/dist/config/peer-role-resolver.js +15 -11
  50. package/dist/config/providers-config.js +12 -7
  51. package/dist/config/providers-import.js +3 -21
  52. package/dist/config/resolved-config-op.js +3 -0
  53. package/dist/config/role-command-service.js +166 -0
  54. package/dist/config/role-request-service.js +193 -0
  55. package/dist/config/schema-migration.js +686 -25
  56. package/dist/config-store.js +79 -3
  57. package/dist/contracts/ecweb-instance.js +41 -0
  58. package/dist/contracts/ecweb-service-protocol.js +3 -1
  59. package/dist/core/agent-application-service.js +11 -1
  60. package/dist/core/agent-ipc-registration.js +4 -0
  61. package/dist/core/agent-runtime.js +1 -1
  62. package/dist/core/auth/agent-delegation.js +82 -6
  63. package/dist/core/auth/auth-gateway.js +1 -1
  64. package/dist/core/auth/authorization-audit.js +37 -9
  65. package/dist/core/auth/delegation-authorization.js +3 -1
  66. package/dist/core/auth/operation-authorizer.js +15 -0
  67. package/dist/core/auth/operation-catalog.js +39 -6
  68. package/dist/core/command/agent-control.js +94 -19
  69. package/dist/core/command/agent-storage-menu.js +5 -3
  70. package/dist/core/command/cli-intent-parser.js +2 -1
  71. package/dist/core/command/command-handler.js +105 -145
  72. package/dist/core/command/connect-menu.js +31 -2
  73. package/dist/core/command/data-root-resolver.js +5 -4
  74. package/dist/core/command/memory-slash.js +16 -8
  75. package/dist/core/command/menu-catalog.js +6 -6
  76. package/dist/core/command/menu-handler.js +87 -163
  77. package/dist/core/command/menu-protocol.js +9 -2
  78. package/dist/core/command/role-menu.js +148 -30
  79. package/dist/core/command/slash-gate.js +13 -10
  80. package/dist/core/command/slash-handler.js +157 -352
  81. package/dist/core/daemon-control.js +8 -14
  82. package/dist/core/event-catalog.js +15 -0
  83. package/dist/core/evolagent-registry.js +4 -4
  84. package/dist/core/evolagent.js +2 -2
  85. package/dist/core/inference/text-inference.js +31 -40
  86. package/dist/core/ipc-registration.js +24 -3
  87. package/dist/core/memory/consolidation-context.js +51 -5
  88. package/dist/core/memory/consolidation-ops-records.js +1 -1
  89. package/dist/core/memory/consolidation-trigger.js +190 -190
  90. package/dist/core/memory/consolidation.js +316 -29
  91. package/dist/core/memory/forget-log.js +96 -0
  92. package/dist/core/memory/index-manager.js +27 -5
  93. package/dist/core/memory/memory-admin.js +45 -5
  94. package/dist/core/memory/memory-writer.js +163 -18
  95. package/dist/core/memory/relation-idle-monitor.js +119 -58
  96. package/dist/core/memory/relation-sweep.js +44 -39
  97. package/dist/core/message/aun-ipc-sender.js +34 -7
  98. package/dist/core/message/aun-request-registry.js +97 -3
  99. package/dist/core/message/im-renderer.js +11 -4
  100. package/dist/core/message/message-admission.js +97 -8
  101. package/dist/core/message/message-bridge.js +71 -24
  102. package/dist/core/message/message-log.js +55 -0
  103. package/dist/core/message/message-queue.js +5 -5
  104. package/dist/core/message/response-engine.js +387 -144
  105. package/dist/core/model/catalog-service.js +4 -2
  106. package/dist/core/model/config-scope.js +24 -64
  107. package/dist/core/model/field-scope.js +1 -1
  108. package/dist/core/model/model-catalog.js +37 -47
  109. package/dist/core/model/model-diagnostics.js +4 -3
  110. package/dist/core/model/model-fallback.js +10 -7
  111. package/dist/core/model/model-permission.js +3 -2
  112. package/dist/core/ownership/owner-resolver.js +25 -23
  113. package/dist/core/permission/ec-command-parser.js +138 -5
  114. package/dist/core/permission/sandbox-runtime.js +18 -1
  115. package/dist/core/permission/tool-policy.js +42 -10
  116. package/dist/core/relation/peer-identity.js +64 -1
  117. package/dist/core/role/runtime-policy.js +72 -13
  118. package/dist/core/session/session-capsule.js +197 -0
  119. package/dist/core/session/session-idle-monitor.js +1 -1
  120. package/dist/core/session/session-manager.js +168 -14
  121. package/dist/core/session/session-mapper.js +2 -0
  122. package/dist/core/session/session-renew.js +3 -3
  123. package/dist/core/skill/index-generator.js +15 -5
  124. package/dist/core/system-session/memory.js +6 -1
  125. package/dist/core/thread/thread-service.js +19 -6
  126. package/dist/directory/owner-directory-admission.js +95 -0
  127. package/dist/directory/owner-directory-authorization.js +309 -0
  128. package/dist/directory/owner-directory-cache.js +635 -0
  129. package/dist/eck/kit-renderer.js +2 -2
  130. package/dist/ecweb/basic-settings-service.js +33 -40
  131. package/dist/ecweb/message-context-service.js +110 -0
  132. package/dist/index.js +79 -17
  133. package/dist/ipc.js +189 -17
  134. package/dist/paths.js +4 -0
  135. package/dist/proxy/command.js +122 -0
  136. package/dist/proxy/ipc-service.js +68 -0
  137. package/dist/proxy/manager.js +485 -0
  138. package/dist/proxy/service-supervisor.js +603 -0
  139. package/dist/response-system/engines/v1/proactive-flow.js +16 -6
  140. package/dist/stats/budget.js +1 -1
  141. package/dist/stats/db.js +15 -0
  142. package/dist/stats/index.js +2 -2
  143. package/dist/stats/price-resolver.js +304 -5
  144. package/dist/stats/query.js +82 -3
  145. package/dist/stats/writer.js +38 -5
  146. package/dist/trigger/feedback.js +18 -7
  147. package/dist/trigger/manager.js +20 -3
  148. package/dist/trigger/parser.js +6 -3
  149. package/dist/trigger/patch.js +1 -1
  150. package/dist/trigger/system-definitions.js +43 -7
  151. package/dist/trigger/validation.js +13 -5
  152. package/dist/utils/cross-platform.js +14 -0
  153. package/dist/utils/ecweb-supervisor.js +258 -83
  154. package/dist/utils/error-utils.js +16 -2
  155. package/dist/utils/logger.js +24 -5
  156. package/dist/utils/npm-ops.js +2 -1
  157. package/dist/utils/package-version-info.js +5 -3
  158. package/dist/utils/upgrade-jobs.js +45 -5
  159. package/kits/docs/INDEX.md +1 -1
  160. package/kits/docs/aun/ABILITY_CALLING.md +20 -2
  161. package/kits/docs/channels/aun.md +9 -0
  162. package/kits/docs/evolcore/INDEX.md +2 -1
  163. package/kits/docs/evolcore/agent-create.md +3 -2
  164. package/kits/docs/evolcore/agent.md +1 -1
  165. package/kits/docs/evolcore/config.md +18 -7
  166. package/kits/docs/evolcore/contact.md +3 -0
  167. package/kits/docs/evolcore/event.md +1 -0
  168. package/kits/docs/evolcore/fs.md +16 -0
  169. package/kits/docs/evolcore/memory-architecture.md +2 -2
  170. package/kits/docs/evolcore/memory-consolidation.md +32 -8
  171. package/kits/docs/evolcore/memory.md +1 -1
  172. package/kits/docs/evolcore/menu-protocol.md +36 -0
  173. package/kits/docs/evolcore/model.md +23 -20
  174. package/kits/docs/evolcore/msg.md +21 -8
  175. package/kits/docs/evolcore/session.md +14 -0
  176. package/kits/migrations/migrate-contact-book-v2.mjs +30 -11
  177. package/kits/schemas/_meta.json +37 -4
  178. package/kits/schemas/agent-config.schema.13.json +23 -3
  179. package/kits/schemas/agent-config.schema.16.json +891 -0
  180. package/kits/schemas/daemon.schema.9.json +366 -0
  181. package/kits/schemas/defaults.schema.5.json +406 -127
  182. package/kits/schemas/relation-config.schema.11.json +260 -0
  183. package/kits/schemas/role-config.schema.1.json +7 -7
  184. package/kits/skills/.switches.json +3 -7
  185. package/kits/skills/aid-ability/SKILL.md +35 -6
  186. package/kits/skills/ec-service-proxy/SKILL.md +118 -0
  187. package/kits/skills/ec-trigger/SKILL.md +13 -5
  188. package/kits/skills/personal-assistant/SKILL.md +176 -0
  189. package/kits/skills/personal-assistant/references/01-workspace-spec.md +333 -0
  190. package/kits/skills/personal-assistant/references/02-bootstrap.md +205 -0
  191. package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +177 -0
  192. package/kits/skills/personal-assistant/references/04-frontend-contract.md +439 -0
  193. package/kits/skills/personal-assistant/references/05-directory-reference.md +292 -0
  194. package/kits/skills/personal-assistant/references/06-render-config.md +350 -0
  195. package/kits/skills/personal-assistant/schema/workspace.schema.json +85 -0
  196. package/kits/skills/personal-assistant/schema/workspace.v1.json +66 -0
  197. package/kits/skills/personal-assistant/scripts/archive.mjs +154 -0
  198. package/kits/skills/personal-assistant/scripts/check.mjs +114 -0
  199. package/kits/skills/personal-assistant/scripts/index-rebuild.mjs +252 -0
  200. package/kits/skills/personal-assistant/scripts/ingest.mjs +344 -0
  201. package/kits/skills/personal-assistant/scripts/init.mjs +270 -0
  202. package/kits/skills/personal-assistant/scripts/lib/apply.mjs +92 -0
  203. package/kits/skills/personal-assistant/scripts/lib/schema.mjs +96 -0
  204. package/kits/skills/personal-assistant/scripts/lib/time.mjs +28 -0
  205. package/kits/skills/personal-assistant/scripts/migrate.mjs +172 -0
  206. package/kits/skills/personal-assistant/scripts/search.mjs +172 -0
  207. package/kits/skills/personal-assistant/scripts/verify.mjs +196 -0
  208. package/kits/skills/personal-assistant/templates/INDEX.md.tpl +24 -0
  209. package/kits/skills/personal-assistant/templates/README.md.tpl +108 -0
  210. package/kits/skills/personal-assistant/triggers/ingest-daily.json +23 -0
  211. package/kits/skills/personal-assistant/triggers/memory-consolidate.json +23 -0
  212. package/kits/skills/personal-assistant/triggers/report-daily.json +23 -0
  213. package/kits/skills/personal-assistant/triggers/report-weekly.json +23 -0
  214. package/kits/templates/memory-consolidation/forget.md +19 -6
  215. package/kits/templates/memory-consolidation/notes.md +1 -1
  216. package/kits/templates/memory-consolidation/profile.md +2 -2
  217. package/kits/templates/memory-consolidation/promote.md +20 -3
  218. package/kits/templates/roles/member.json +8 -1
  219. package/kits/templates/session-capsule/recovery.md +5 -0
  220. package/kits/templates/session-capsule/renew.md +5 -0
  221. package/kits/templates/system-fragments/baseagent.md +2 -2
  222. package/kits/templates/system-fragments/bootstrap.md +6 -6
  223. package/kits/templates/system-fragments/channel.md +1 -1
  224. package/kits/templates/system-fragments/memory.md +4 -4
  225. package/package.json +7 -3
  226. package/dist/stats/billing.js +0 -215
@@ -0,0 +1,891 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "agent-config.schema.16.json",
4
+ "title": "AgentConfig v16 (agents/{aid}/config.json)",
5
+ "description": "增加 Owner 通讯录和 Owner Agent 名录的入站联系开关。",
6
+ "x-logical-name": "agent-config",
7
+ "x-scope": "agent",
8
+ "type": "object",
9
+ "additionalProperties": false,
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
+ "description": "debug 是 daemon 进程级配置,不进入 Agent 覆盖链。",
33
+ "required": [
34
+ "debug"
35
+ ]
36
+ }
37
+ ]
38
+ },
39
+ "required": [
40
+ "aid",
41
+ "channels"
42
+ ],
43
+ "properties": {
44
+ "$schema_version": {
45
+ "type": "number",
46
+ "const": 16,
47
+ "default": 16,
48
+ "x-merge": "scalar",
49
+ "description": "配置 Schema 版本;v16 添加 Owner 名录入站联系策略"
50
+ },
51
+ "aid": {
52
+ "type": "string",
53
+ "x-merge": "scalar",
54
+ "description": "Agent 的全局唯一身份标识"
55
+ },
56
+ "enabled": {
57
+ "type": "boolean",
58
+ "default": true,
59
+ "x-merge": "scalar",
60
+ "description": "是否启用 Agent;缺省按启用处理"
61
+ },
62
+ "lifecycle": {
63
+ "type": "string",
64
+ "default": "active",
65
+ "enum": [
66
+ "created",
67
+ "ownerpending",
68
+ "bootstrapping",
69
+ "active"
70
+ ],
71
+ "x-merge": "scalar",
72
+ "description": "agent 生命周期状态;缺失时按 active 处理",
73
+ "x-enumDescriptions": {
74
+ "created": "已创建,尚未进入引导流程",
75
+ "ownerpending": "初始名片已发布,等待协议 Owner 共识",
76
+ "bootstrapping": "引导中(初始化配置/身份)",
77
+ "active": "已激活,正常运行"
78
+ }
79
+ },
80
+ "initialization": {
81
+ "type": "object",
82
+ "x-merge": "scalar",
83
+ "additionalProperties": false,
84
+ "required": [
85
+ "mode",
86
+ "operationId"
87
+ ],
88
+ "properties": {
89
+ "mode": {
90
+ "const": "supplied"
91
+ },
92
+ "operationId": {
93
+ "type": "string",
94
+ "pattern": "^init-[a-f0-9]{24}$"
95
+ }
96
+ },
97
+ "description": "Creation-service owned initialization operation"
98
+ },
99
+ "initialized": {
100
+ "type": "boolean",
101
+ "x-merge": "scalar",
102
+ "description": "是否已完成 Agent 初始化流程"
103
+ },
104
+ "owners": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "string",
108
+ "description": "一个 Agent owner 的身份标识,通常为 AID。"
109
+ },
110
+ "uniqueItems": true,
111
+ "x-merge": "list",
112
+ "description": "Agent 所有者身份列表;用于 owner 级控制和通知"
113
+ },
114
+ "owner": {
115
+ "type": "string",
116
+ "description": "本地兼容的单个 Agent Owner AID;与 owners 合并读取",
117
+ "x-merge": "scalar"
118
+ },
119
+ "fullaccess": {
120
+ "type": "object",
121
+ "x-merge": "dict",
122
+ "additionalProperties": false,
123
+ "properties": {
124
+ "enabled": {
125
+ "type": "boolean",
126
+ "default": false,
127
+ "description": "允许同时属于 AgentOwner 与 daemonOwner 的直接私聊任务使用宿主级 fullaccess"
128
+ }
129
+ },
130
+ "description": "Agent 级宿主执行策略;已认证 EC Web 或目标 Agent 与 daemon 的双 Owner 直接 Menu 可设置,不从 defaults 或 relation 继承"
131
+ },
132
+ "access": {
133
+ "type": "object",
134
+ "x-merge": "dict",
135
+ "additionalProperties": false,
136
+ "required": [
137
+ "policyMode",
138
+ "requestLimit"
139
+ ],
140
+ "properties": {
141
+ "policyMode": {
142
+ "type": "string",
143
+ "enum": [
144
+ "open",
145
+ "contacts",
146
+ "owners"
147
+ ],
148
+ "description": "私聊和群聊准入策略:开放、仅联系人或仅 Owner。"
149
+ },
150
+ "allowOwnerDirectoryContacts": {
151
+ "type": "boolean",
152
+ "default": true,
153
+ "description": "是否允许 Owner 通讯录中的主体联系本 Agent。"
154
+ },
155
+ "allowOwnerAgentDirectory": {
156
+ "type": "boolean",
157
+ "default": true,
158
+ "description": "是否允许 Owner Agent 名录中的 Agent 联系本 Agent。"
159
+ },
160
+ "allowExternalContacts": {
161
+ "type": "boolean",
162
+ "default": false,
163
+ "description": "未命中 Owner 名录时是否允许普通外部联系;由 policyMode 继续判断。"
164
+ },
165
+ "allowedAids": {
166
+ "type": "array",
167
+ "items": {
168
+ "type": "string",
169
+ "pattern": "^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?){2,}$"
170
+ },
171
+ "uniqueItems": true,
172
+ "default": [],
173
+ "description": "未命中 Owner 名录时的指定 AID 准入例外;不覆盖名录关闭或私聊拉黑,不授予角色权限。"
174
+ },
175
+ "requestLimit": {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "required": [
179
+ "maxTimes",
180
+ "coolDown"
181
+ ],
182
+ "properties": {
183
+ "maxTimes": {
184
+ "type": "integer",
185
+ "minimum": 1,
186
+ "maximum": 100000,
187
+ "description": "每个 Agent、每个渠道实例在窗口内最多发送的准入控制消息数。"
188
+ },
189
+ "coolDown": {
190
+ "type": "integer",
191
+ "minimum": 1,
192
+ "maximum": 86400,
193
+ "description": "准入控制消息限额的冷却窗口,单位秒。"
194
+ }
195
+ }
196
+ }
197
+ },
198
+ "description": "Agent 自身的消息准入策略;不参与 defaults 或 relation 覆盖链。"
199
+ },
200
+ "channels": {
201
+ "type": "array",
202
+ "items": {
203
+ "type": "object",
204
+ "allOf": [
205
+ {
206
+ "if": {
207
+ "properties": {
208
+ "type": {
209
+ "const": "aun"
210
+ }
211
+ },
212
+ "required": [
213
+ "type"
214
+ ]
215
+ },
216
+ "then": {
217
+ "not": {
218
+ "required": [
219
+ "gatewayUrl"
220
+ ]
221
+ }
222
+ }
223
+ }
224
+ ],
225
+ "description": "一个渠道实例配置;具体字段由渠道类型及其适配器定义。"
226
+ },
227
+ "x-merge": "list",
228
+ "description": "Agent 绑定的消息渠道实例列表"
229
+ },
230
+ "aun": {
231
+ "type": "object",
232
+ "x-merge": "dict",
233
+ "description": "Agent 级 AUN 通信配置",
234
+ "properties": {
235
+ "gatewayUrl": {
236
+ "not": {},
237
+ "description": "已移除;网关由 fastaun 缓存和 AID discovery 决定"
238
+ },
239
+ "defaultEncrypt": {
240
+ "not": {},
241
+ "description": "不支持在 Agent 配置;请使用 daemon.json.aun.defaultEncrypt"
242
+ }
243
+ }
244
+ },
245
+ "active_baseagent": {
246
+ "type": "string",
247
+ "x-merge": "scalar",
248
+ "description": "默认使用的 base agent 标识:claude/codex/gemini/ecagent"
249
+ },
250
+ "baseagents": {
251
+ "type": "object",
252
+ "x-merge": "dict",
253
+ "description": "按 base agent 配置模型选择(模型 / 服务商 / 推理强度 / 降级链)与运行参数;连接地址与密钥在 providers.json。",
254
+ "propertyNames": {
255
+ "enum": [
256
+ "claude",
257
+ "codex",
258
+ "gemini",
259
+ "ecagent"
260
+ ]
261
+ },
262
+ "additionalProperties": false,
263
+ "properties": {
264
+ "claude": {
265
+ "type": "object",
266
+ "additionalProperties": false,
267
+ "properties": {
268
+ "model": {
269
+ "type": "string",
270
+ "minLength": 1,
271
+ "description": "该 base agent 使用的模型。"
272
+ },
273
+ "provider": {
274
+ "type": "string",
275
+ "minLength": 1,
276
+ "pattern": "^[A-Za-z0-9_-]+$",
277
+ "description": "providers.json 中的服务商 id;缺省用 base agent 自带网关。"
278
+ },
279
+ "effort": {
280
+ "type": "string",
281
+ "enum": [
282
+ "low",
283
+ "medium",
284
+ "high",
285
+ "xhigh",
286
+ "max"
287
+ ],
288
+ "description": "推理强度。"
289
+ },
290
+ "fallback": {
291
+ "type": "array",
292
+ "maxItems": 3,
293
+ "description": "同 provider 服务类型的降级链;每一项都要显式写明 provider、model 和 effort。",
294
+ "items": {
295
+ "type": "object",
296
+ "additionalProperties": false,
297
+ "required": [
298
+ "provider",
299
+ "model",
300
+ "effort"
301
+ ],
302
+ "properties": {
303
+ "provider": {
304
+ "type": "string",
305
+ "minLength": 1,
306
+ "pattern": "^[A-Za-z0-9_-]+$"
307
+ },
308
+ "model": {
309
+ "type": "string",
310
+ "minLength": 1
311
+ },
312
+ "effort": {
313
+ "type": "string",
314
+ "enum": [
315
+ "low",
316
+ "medium",
317
+ "high",
318
+ "xhigh",
319
+ "max"
320
+ ]
321
+ }
322
+ }
323
+ }
324
+ },
325
+ "agentProgressSummaries": {
326
+ "type": "boolean",
327
+ "description": "打开 SDK 进度摘要(默认 true)。"
328
+ },
329
+ "excludeDynamicSections": {
330
+ "type": "boolean",
331
+ "description": "系统提示词去掉动态段以稳定提示缓存(默认 false)。"
332
+ },
333
+ "useSettingSources": {
334
+ "type": "boolean",
335
+ "description": "读取 project/user 两级 settings(默认 true;fullaccess 强制不读)。"
336
+ },
337
+ "pathToClaudeCodeExecutable": {
338
+ "type": "string",
339
+ "minLength": 1,
340
+ "description": "自定义 Claude Code 可执行文件路径。"
341
+ }
342
+ }
343
+ },
344
+ "codex": {
345
+ "type": "object",
346
+ "additionalProperties": false,
347
+ "properties": {
348
+ "model": {
349
+ "type": "string",
350
+ "minLength": 1,
351
+ "description": "该 base agent 使用的模型。"
352
+ },
353
+ "provider": {
354
+ "type": "string",
355
+ "minLength": 1,
356
+ "pattern": "^[A-Za-z0-9_-]+$",
357
+ "description": "providers.json 中的服务商 id;缺省用 base agent 自带网关。"
358
+ },
359
+ "effort": {
360
+ "type": "string",
361
+ "enum": [
362
+ "low",
363
+ "medium",
364
+ "high",
365
+ "xhigh",
366
+ "max"
367
+ ],
368
+ "description": "推理强度。"
369
+ },
370
+ "fallback": {
371
+ "type": "array",
372
+ "maxItems": 3,
373
+ "description": "同 provider 服务类型的降级链;每一项都要显式写明 provider、model 和 effort。",
374
+ "items": {
375
+ "type": "object",
376
+ "additionalProperties": false,
377
+ "required": [
378
+ "provider",
379
+ "model",
380
+ "effort"
381
+ ],
382
+ "properties": {
383
+ "provider": {
384
+ "type": "string",
385
+ "minLength": 1,
386
+ "pattern": "^[A-Za-z0-9_-]+$"
387
+ },
388
+ "model": {
389
+ "type": "string",
390
+ "minLength": 1
391
+ },
392
+ "effort": {
393
+ "type": "string",
394
+ "enum": [
395
+ "low",
396
+ "medium",
397
+ "high",
398
+ "xhigh",
399
+ "max"
400
+ ]
401
+ }
402
+ }
403
+ }
404
+ },
405
+ "enableRequestUserInput": {
406
+ "type": "boolean",
407
+ "description": "Default 模式允许阻塞式 request_user_input(默认 true);不影响异步问题与审批。"
408
+ }
409
+ }
410
+ },
411
+ "gemini": {
412
+ "type": "object",
413
+ "additionalProperties": false,
414
+ "properties": {
415
+ "model": {
416
+ "type": "string",
417
+ "minLength": 1,
418
+ "description": "该 base agent 使用的模型。"
419
+ },
420
+ "provider": {
421
+ "type": "string",
422
+ "minLength": 1,
423
+ "pattern": "^[A-Za-z0-9_-]+$",
424
+ "description": "providers.json 中的服务商 id;缺省用 base agent 自带网关。"
425
+ },
426
+ "effort": {
427
+ "type": "string",
428
+ "enum": [
429
+ "low",
430
+ "medium",
431
+ "high",
432
+ "xhigh",
433
+ "max"
434
+ ],
435
+ "description": "推理强度。"
436
+ },
437
+ "fallback": {
438
+ "type": "array",
439
+ "maxItems": 3,
440
+ "description": "同 provider 服务类型的降级链;每一项都要显式写明 provider、model 和 effort。",
441
+ "items": {
442
+ "type": "object",
443
+ "additionalProperties": false,
444
+ "required": [
445
+ "provider",
446
+ "model",
447
+ "effort"
448
+ ],
449
+ "properties": {
450
+ "provider": {
451
+ "type": "string",
452
+ "minLength": 1,
453
+ "pattern": "^[A-Za-z0-9_-]+$"
454
+ },
455
+ "model": {
456
+ "type": "string",
457
+ "minLength": 1
458
+ },
459
+ "effort": {
460
+ "type": "string",
461
+ "enum": [
462
+ "low",
463
+ "medium",
464
+ "high",
465
+ "xhigh",
466
+ "max"
467
+ ]
468
+ }
469
+ }
470
+ }
471
+ },
472
+ "cliPath": {
473
+ "type": "string",
474
+ "minLength": 1,
475
+ "description": "Gemini CLI 可执行文件路径;缺省自动探测。"
476
+ }
477
+ }
478
+ },
479
+ "ecagent": {
480
+ "type": "object",
481
+ "additionalProperties": false,
482
+ "properties": {
483
+ "model": {
484
+ "type": "string",
485
+ "minLength": 1,
486
+ "description": "该 base agent 使用的模型。"
487
+ },
488
+ "provider": {
489
+ "type": "string",
490
+ "minLength": 1,
491
+ "pattern": "^[A-Za-z0-9_-]+$",
492
+ "description": "providers.json 中的服务商 id;缺省用 base agent 自带网关。"
493
+ },
494
+ "effort": {
495
+ "type": "string",
496
+ "enum": [
497
+ "low",
498
+ "medium",
499
+ "high",
500
+ "xhigh",
501
+ "max"
502
+ ],
503
+ "description": "推理强度。"
504
+ },
505
+ "fallback": {
506
+ "type": "array",
507
+ "maxItems": 3,
508
+ "description": "同 provider 服务类型的降级链;每一项都要显式写明 provider、model 和 effort。",
509
+ "items": {
510
+ "type": "object",
511
+ "additionalProperties": false,
512
+ "required": [
513
+ "provider",
514
+ "model",
515
+ "effort"
516
+ ],
517
+ "properties": {
518
+ "provider": {
519
+ "type": "string",
520
+ "minLength": 1,
521
+ "pattern": "^[A-Za-z0-9_-]+$"
522
+ },
523
+ "model": {
524
+ "type": "string",
525
+ "minLength": 1
526
+ },
527
+ "effort": {
528
+ "type": "string",
529
+ "enum": [
530
+ "low",
531
+ "medium",
532
+ "high",
533
+ "xhigh",
534
+ "max"
535
+ ]
536
+ }
537
+ }
538
+ }
539
+ },
540
+ "timeoutMs": {
541
+ "type": "number",
542
+ "minimum": 1,
543
+ "description": "单次网关请求超时毫秒(默认 120000)。"
544
+ },
545
+ "maxRetries": {
546
+ "type": "number",
547
+ "minimum": 0,
548
+ "description": "失败重试次数(默认 2;总尝试 = 重试 + 1)。"
549
+ },
550
+ "maxRetryDelayMs": {
551
+ "type": "number",
552
+ "minimum": 0,
553
+ "description": "重试退避上限毫秒(默认 4000)。"
554
+ }
555
+ }
556
+ }
557
+ }
558
+ },
559
+ "Services": {
560
+ "type": "object",
561
+ "description": "按用途选择 provider、模型、推理强度和降级链;用途名可扩展(如 decision)。",
562
+ "x-merge": "dict",
563
+ "propertyNames": {
564
+ "pattern": "^[A-Za-z0-9_-]+$"
565
+ },
566
+ "additionalProperties": {
567
+ "type": "object",
568
+ "additionalProperties": false,
569
+ "properties": {
570
+ "provider": {
571
+ "type": "string",
572
+ "minLength": 1
573
+ },
574
+ "model": {
575
+ "type": "string",
576
+ "minLength": 1
577
+ },
578
+ "effort": {
579
+ "type": "string",
580
+ "minLength": 1
581
+ },
582
+ "fallback": {
583
+ "type": "array",
584
+ "maxItems": 3,
585
+ "items": {
586
+ "type": "object",
587
+ "additionalProperties": false,
588
+ "required": [
589
+ "provider",
590
+ "model",
591
+ "effort"
592
+ ],
593
+ "properties": {
594
+ "provider": {
595
+ "type": "string",
596
+ "minLength": 1,
597
+ "pattern": "^[A-Za-z0-9_-]+$"
598
+ },
599
+ "model": {
600
+ "type": "string",
601
+ "minLength": 1
602
+ },
603
+ "effort": {
604
+ "type": "string",
605
+ "minLength": 1
606
+ }
607
+ }
608
+ }
609
+ }
610
+ }
611
+ }
612
+ },
613
+ "projects": {
614
+ "type": "object",
615
+ "x-merge": "dict",
616
+ "description": "Agent 可用项目路径和项目选择配置"
617
+ },
618
+ "capabilities": {
619
+ "type": "object",
620
+ "x-merge": "dict",
621
+ "description": "Agent 能力开关及能力参数"
622
+ },
623
+ "readonlySourceDiagnostics": {
624
+ "type": "boolean",
625
+ "x-merge": "scalar",
626
+ "default": false,
627
+ "description": "允许只读会话在显式源码目录内执行受限、可证明只读的诊断查询"
628
+ },
629
+ "observable": {
630
+ "type": "boolean",
631
+ "default": true,
632
+ "x-merge": "scalar",
633
+ "description": "是否将 Agent 的入站和出站消息转发给 owners;默认开启"
634
+ },
635
+ "chatmode": {
636
+ "type": "object",
637
+ "x-merge": "dict",
638
+ "default": {
639
+ "private": "interactive",
640
+ "group": "proactive",
641
+ "nothuman": "proactive"
642
+ },
643
+ "properties": {
644
+ "private": {
645
+ "enum": [
646
+ "interactive",
647
+ "proactive"
648
+ ],
649
+ "description": "人类私聊场景的投递方式",
650
+ "x-enumDescriptions": {
651
+ "interactive": "同步交互:输出即回复",
652
+ "proactive": "主动推送:CLI 回复 + 思考投影"
653
+ }
654
+ },
655
+ "group": {
656
+ "enum": [
657
+ "interactive",
658
+ "proactive"
659
+ ],
660
+ "description": "群聊场景的投递方式",
661
+ "x-enumDescriptions": {
662
+ "interactive": "同步交互:输出即回复",
663
+ "proactive": "主动推送:CLI 回复 + 思考投影"
664
+ }
665
+ },
666
+ "nothuman": {
667
+ "enum": [
668
+ "interactive",
669
+ "proactive"
670
+ ],
671
+ "description": "非人类(agent)私聊场景的投递方式",
672
+ "x-enumDescriptions": {
673
+ "interactive": "同步交互:输出即回复",
674
+ "proactive": "主动推送:CLI 回复 + 思考投影"
675
+ }
676
+ }
677
+ },
678
+ "additionalProperties": false,
679
+ "description": "chatmode 场景默认表;出厂默认值即此 default(agent 级改默认,关系级按键覆盖)。键封闭 private/group/nothuman,值枚举 interactive/proactive"
680
+ },
681
+ "mentionMode": {
682
+ "type": "string",
683
+ "enum": [
684
+ "disabled",
685
+ "mention-only",
686
+ "auto"
687
+ ],
688
+ "default": "disabled",
689
+ "x-merge": "scalar",
690
+ "description": "@ 处理策略(顶层通用参数)",
691
+ "x-enumDescriptions": {
692
+ "disabled": "处理所有消息",
693
+ "mention-only": "只处理被 @ 的消息,未 @ 作引用上下文"
694
+ }
695
+ },
696
+ "autoMentionQuietWindowMs": {
697
+ "type": "number",
698
+ "minimum": 0,
699
+ "default": 3000,
700
+ "x-merge": "scalar",
701
+ "description": "群聊 auto 注意力分类的静默等待窗口,单位为毫秒;默认 3000"
702
+ },
703
+ "groupSlashRequireMentions": {
704
+ "type": "boolean",
705
+ "default": true,
706
+ "x-merge": "scalar",
707
+ "description": "AUN 群聊 slash 命令是否必须携带结构化 mentions;默认必须"
708
+ },
709
+ "responseMode": {
710
+ "type": "string",
711
+ "x-merge": "scalar",
712
+ "description": "响应模式 id(标量);候选清单/默认值来自注册表,非 schema。关系级>agent级>注册表首选"
713
+ },
714
+ "responseModeParams": {
715
+ "type": "object",
716
+ "x-merge": "dict",
717
+ "description": "响应模式特有参数字典,按模式 id 分桶:{ [modeId]: {...} }"
718
+ },
719
+ "flush_delay": {
720
+ "type": "number",
721
+ "minimum": 0,
722
+ "default": 3,
723
+ "x-merge": "scalar",
724
+ "description": "流式出站消息的批量刷新间隔,单位为秒;默认 3 秒"
725
+ },
726
+ "debounce": {
727
+ "type": "number",
728
+ "minimum": 0,
729
+ "default": 0,
730
+ "x-merge": "scalar",
731
+ "description": "入站消息合并窗口,单位为秒;0 表示不合并,默认 0"
732
+ },
733
+ "show_activities": {
734
+ "type": "string",
735
+ "enum": [
736
+ "all",
737
+ "text",
738
+ "none"
739
+ ],
740
+ "default": "all",
741
+ "x-merge": "scalar",
742
+ "description": "中间输出展示范围(仅对 interactive 私聊有意义)",
743
+ "x-enumDescriptions": {
744
+ "all": "文本 + activity",
745
+ "text": "仅文本",
746
+ "none": "全部静默"
747
+ }
748
+ },
749
+ "session_renew": {
750
+ "type": "object",
751
+ "x-merge": "dict",
752
+ "additionalProperties": false,
753
+ "description": "会话超时后的续接判定",
754
+ "properties": {
755
+ "enabled": {
756
+ "type": "boolean",
757
+ "default": false,
758
+ "description": "是否启用超时后的会话连续性判定"
759
+ },
760
+ "after_hours": {
761
+ "type": "number",
762
+ "exclusiveMinimum": 0,
763
+ "default": 24,
764
+ "description": "距最后一条有效对话超过该小时数才触发判定"
765
+ },
766
+ "fallback_action": {
767
+ "type": "string",
768
+ "enum": [
769
+ "continue",
770
+ "new"
771
+ ],
772
+ "default": "continue",
773
+ "description": "无法判定时的兜底动作",
774
+ "x-enumDescriptions": {
775
+ "continue": "继续沿用当前会话",
776
+ "new": "开启新会话"
777
+ }
778
+ },
779
+ "new_probability_threshold": {
780
+ "type": "number",
781
+ "minimum": 0,
782
+ "maximum": 1,
783
+ "default": 0.85,
784
+ "description": "noul 达到该概率后开启新会话"
785
+ }
786
+ }
787
+ },
788
+ "group_venue_sync": {
789
+ "type": "object",
790
+ "x-merge": "dict",
791
+ "description": "AUN 群资源同步配置;控制规则文件路径、资源索引路径、条目/字节限制及刷新间隔。"
792
+ },
793
+ "groupRules": {
794
+ "type": "object",
795
+ "x-merge": "dict",
796
+ "additionalProperties": false,
797
+ "properties": {
798
+ "mode": {
799
+ "type": "string",
800
+ "enum": [
801
+ "load",
802
+ "ignore"
803
+ ],
804
+ "default": "load",
805
+ "description": "是否读取并注入 AUN 群已发布的 /rules.md;默认 load。"
806
+ }
807
+ },
808
+ "description": "本 Agent 对 AUN 群规则的本地加载策略。"
809
+ },
810
+ "render": {
811
+ "type": "object",
812
+ "x-merge": "dict",
813
+ "description": "私聊、群聊及注入内容使用的渲染器标识配置。"
814
+ },
815
+ "sessionManifests": {
816
+ "type": "object",
817
+ "x-merge": "dict",
818
+ "description": "会话类型到 manifest 文件的映射,用于选择对应的系统提示词清单。"
819
+ },
820
+ "enable_rich_content": {
821
+ "type": "boolean",
822
+ "x-merge": "scalar",
823
+ "description": "是否允许渠道使用富内容消息;未设置时由渠道能力和运行时默认决定"
824
+ },
825
+ "extra_backup": {
826
+ "type": "array",
827
+ "items": {
828
+ "type": "object",
829
+ "description": "一个额外备份规则,包含相对 path 和可选的文件匹配 pattern。"
830
+ },
831
+ "x-merge": "list",
832
+ "description": "配置快照需要额外包含的文件声明;不得指向 .env。"
833
+ },
834
+ "memory": {
835
+ "type": "object",
836
+ "x-merge": "dict",
837
+ "additionalProperties": false,
838
+ "description": "记忆系统配置。enableRelation 是总开关(relation 是所有记忆的唯一出生地);它在关系层使用 x-merge-logic: AND 语义,任意层为 false 则关闭。",
839
+ "properties": {
840
+ "enableRelation": {
841
+ "type": "boolean",
842
+ "x-merge-logic": "AND",
843
+ "description": "启用 relation 作用域记忆。默认 true。这是总开关:关闭后 agent 级与 owner 级记忆也无从产生,note 写入、索引注入、五种整理模式的触发器与手动调用一并停用。relation 层可用此字段做 AND 合并(任意层为 false 则关闭)。"
844
+ },
845
+ "enableAgent": {
846
+ "type": "boolean",
847
+ "description": "启用 agent 作用域记忆(泛化模式的产出)。默认 true。"
848
+ },
849
+ "enableOwner": {
850
+ "type": "boolean",
851
+ "description": "启用 owner 作用域记忆(提升模式的产出)。默认 true。"
852
+ },
853
+ "idleHours": {
854
+ "type": "number",
855
+ "description": "关系空闲时长(小时):一个关系最后一次活动(入站、写 note)后这么久没有新活动,触发该关系的整理链,只跑候选攒够 minBatchItems 的步骤。默认 1。"
856
+ },
857
+ "maxUnconsolidatedHours": {
858
+ "type": "number",
859
+ "description": "关系兜底整理时长(小时):一个关系最早一次未整理的活动满这么久,即使仍在聊也触发整理链,有 1 条候选就跑。默认 8。"
860
+ },
861
+ "minBatchItems": {
862
+ "type": "number",
863
+ "minimum": 1,
864
+ "description": "空闲到期时一步至少攒够多少条候选才跑(note 条数 / to-generalize 条数 / to-promote 条数),不够的留给兜底。默认 3。"
865
+ },
866
+ "checkIntervalHours": {
867
+ "type": "number",
868
+ "description": "定时触发器检查间隔(小时)。默认 1。"
869
+ },
870
+ "backlogHours": {
871
+ "type": "number",
872
+ "description": "已废弃,不再生效(pending 由关系空闲 / 兜底计时覆盖)。保留只为旧配置文件仍能通过校验。"
873
+ },
874
+ "indexMaxBytes": {
875
+ "type": "number",
876
+ "description": "MEMORY.md 索引大小上限(字节)。默认 5120(5KB)。"
877
+ },
878
+ "forgetAfterDays": {
879
+ "type": "number",
880
+ "minimum": 1,
881
+ "maximum": 7,
882
+ "description": "普通记忆多久(天)未更新即进入遗忘候选。默认 3,允许 1-7。打了 long-term 的记忆固定 30 天,不受此值影响。"
883
+ },
884
+ "profileRegenDays": {
885
+ "type": "number",
886
+ "description": "间隔多久(天)重新生成一次画像。默认 3。"
887
+ }
888
+ }
889
+ }
890
+ }
891
+ }