evolcore 0.0.1 → 0.0.3

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 (379) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/LICENSE +21 -0
  3. package/MIGRATION-0.5.0.md +378 -0
  4. package/README.md +318 -14
  5. package/ROLE_ACCESS_CONTROL.md +174 -0
  6. package/assets/.env.template +4 -0
  7. package/bin/ec-safe-output.js +161 -0
  8. package/bin/ec.js +29 -0
  9. package/dist/agents/baseagent.js +163 -0
  10. package/dist/agents/claude-runner.js +2565 -0
  11. package/dist/agents/codex-app-server-client.js +448 -0
  12. package/dist/agents/codex-runner.js +2682 -0
  13. package/dist/agents/gemini-runner.js +666 -0
  14. package/dist/agents/runner-types.js +75 -0
  15. package/dist/aun/aid/agentmd.js +216 -0
  16. package/dist/aun/aid/client.js +132 -0
  17. package/dist/aun/aid/control-aid.js +91 -0
  18. package/dist/aun/aid/identity.js +518 -0
  19. package/dist/aun/aid/index.js +4 -0
  20. package/dist/aun/aid/store.js +74 -0
  21. package/dist/aun/aid/types.js +1 -0
  22. package/dist/aun/aid/validation.js +21 -0
  23. package/dist/aun/group-identity.js +10 -0
  24. package/dist/aun/msg/group-index.js +6 -0
  25. package/dist/aun/msg/group.js +1231 -0
  26. package/dist/aun/msg/history.js +123 -0
  27. package/dist/aun/msg/index.js +5 -0
  28. package/dist/aun/msg/p2p.js +393 -0
  29. package/dist/aun/msg/payload-type.js +27 -0
  30. package/dist/aun/msg/upload.js +137 -0
  31. package/dist/aun/outbox.js +168 -0
  32. package/dist/aun/rpc/caller.js +42 -0
  33. package/dist/aun/rpc/connection.js +25 -0
  34. package/dist/aun/rpc/index.js +2 -0
  35. package/dist/aun/service-proxy.js +225 -0
  36. package/dist/aun/storage/download.js +29 -0
  37. package/dist/aun/storage/index.js +3 -0
  38. package/dist/aun/storage/manage.js +10 -0
  39. package/dist/aun/storage/upload.js +68 -0
  40. package/dist/channels/aun.js +4164 -0
  41. package/dist/channels/contact-bind-code.js +134 -0
  42. package/dist/channels/daemon.js +422 -0
  43. package/dist/channels/dingtalk.js +1479 -0
  44. package/dist/channels/feishu.js +1865 -0
  45. package/dist/channels/qqbot.js +409 -0
  46. package/dist/channels/wechat.js +817 -0
  47. package/dist/channels/wecom-card.js +101 -0
  48. package/dist/channels/wecom-onboarding.js +82 -0
  49. package/dist/channels/wecom-state.js +191 -0
  50. package/dist/channels/wecom.js +1157 -0
  51. package/dist/cli/agent-command.js +642 -0
  52. package/dist/cli/agent.js +1059 -0
  53. package/dist/cli/aun-commands.js +2003 -0
  54. package/dist/cli/bench.js +1228 -0
  55. package/dist/cli/cli-argv.js +66 -0
  56. package/dist/cli/code-stats.js +329 -0
  57. package/dist/cli/command-log.js +82 -0
  58. package/dist/cli/config-selector.js +69 -0
  59. package/dist/cli/config.js +261 -0
  60. package/dist/cli/contact.js +71 -0
  61. package/dist/cli/ctl-command.js +62 -0
  62. package/dist/cli/daemon-commands.js +2750 -0
  63. package/dist/cli/fs-command.js +1447 -0
  64. package/dist/cli/handoff-command.js +302 -0
  65. package/dist/cli/help.js +35 -0
  66. package/dist/cli/index.js +374 -0
  67. package/dist/cli/init-channel.js +1372 -0
  68. package/dist/cli/init.js +590 -0
  69. package/dist/cli/link-rules.js +240 -0
  70. package/dist/cli/model.js +591 -0
  71. package/dist/cli/net-check.js +723 -0
  72. package/dist/cli/queue-command.js +150 -0
  73. package/dist/cli/raw-key-input.js +25 -0
  74. package/dist/cli/response.js +344 -0
  75. package/dist/cli/restart-monitor.js +480 -0
  76. package/dist/cli/stats.js +609 -0
  77. package/dist/cli/task-context.js +80 -0
  78. package/dist/cli/trigger-command.js +545 -0
  79. package/dist/cli/version.js +93 -0
  80. package/dist/cli/watch-logs.js +33 -0
  81. package/dist/cli/watch-msg.js +673 -0
  82. package/dist/config/boot-log.js +266 -0
  83. package/dist/config/builtin-role-templates.js +42 -0
  84. package/dist/config/builtin-roles.js +91 -0
  85. package/dist/config/config-batch-get.js +11 -0
  86. package/dist/config/config-field-policy.js +261 -0
  87. package/dist/config/config-manager.js +1120 -0
  88. package/dist/config/config-operation-service.js +384 -0
  89. package/dist/config/contact-alias.js +68 -0
  90. package/dist/config/contact-book-store.js +454 -0
  91. package/dist/config/contact-book-v2-startup.js +35 -0
  92. package/dist/config/contact-book.js +224 -0
  93. package/dist/config/contact-operation-service.js +110 -0
  94. package/dist/config/gateway-config.js +858 -0
  95. package/dist/config/lifecycle.js +17 -0
  96. package/dist/config/mention-mode.js +27 -0
  97. package/dist/config/merge.js +161 -0
  98. package/dist/config/owner-policy.js +4 -0
  99. package/dist/config/peer-role-resolver.js +218 -0
  100. package/dist/config/resolved-config-op.js +483 -0
  101. package/dist/config/role-config-v4-startup.js +32 -0
  102. package/dist/config/role-config-v5-startup.js +27 -0
  103. package/dist/config/role-ranks.js +18 -0
  104. package/dist/config/role-schema.js +105 -0
  105. package/dist/config/role-service.js +156 -0
  106. package/dist/config/role-store.js +215 -0
  107. package/dist/config/roles.js +64 -0
  108. package/dist/config/schema-registry.js +154 -0
  109. package/dist/config/snapshot.js +598 -0
  110. package/dist/config-store.js +501 -0
  111. package/dist/core/auth/agent-delegation.js +111 -0
  112. package/dist/core/auth/auth-gateway.js +166 -0
  113. package/dist/core/auth/authenticated-actor.js +6 -0
  114. package/dist/core/auth/authorization-audit.js +119 -0
  115. package/dist/core/auth/operation-authorizer.js +720 -0
  116. package/dist/core/auth/operation-catalog.js +731 -0
  117. package/dist/core/baseagent-loader.js +54 -0
  118. package/dist/core/bootstrap-service.js +175 -0
  119. package/dist/core/capability/capability-manager.js +316 -0
  120. package/dist/core/capability/providers/claude-capability-provider.js +176 -0
  121. package/dist/core/capability/providers/codex-capability-provider.js +148 -0
  122. package/dist/core/capability/providers/gemini-capability-provider.js +10 -0
  123. package/dist/core/capability/types.js +27 -0
  124. package/dist/core/causation/audit.js +103 -0
  125. package/dist/core/causation/aun-association.js +111 -0
  126. package/dist/core/causation/context.js +93 -0
  127. package/dist/core/causation/index.js +4 -0
  128. package/dist/core/causation/types.js +2 -0
  129. package/dist/core/channel-loader.js +277 -0
  130. package/dist/core/command/agent-control.js +616 -0
  131. package/dist/core/command/cli-intent-parser.js +225 -0
  132. package/dist/core/command/command-handler.js +1733 -0
  133. package/dist/core/command/connect-menu.js +374 -0
  134. package/dist/core/command/menu-handler.js +3452 -0
  135. package/dist/core/command/menu-protocol.js +247 -0
  136. package/dist/core/command/role-menu.js +1623 -0
  137. package/dist/core/command/slash-gate.js +148 -0
  138. package/dist/core/command/slash-handler.js +3066 -0
  139. package/dist/core/daemon-file-cache.js +222 -0
  140. package/dist/core/event-bus.js +32 -0
  141. package/dist/core/event-catalog.js +810 -0
  142. package/dist/core/evolagent-registry.js +545 -0
  143. package/dist/core/evolagent.js +342 -0
  144. package/dist/core/handoff/dispatcher.js +229 -0
  145. package/dist/core/handoff/mutex.js +46 -0
  146. package/dist/core/handoff/runtime.js +324 -0
  147. package/dist/core/handoff/store.js +537 -0
  148. package/dist/core/handoff/types.js +12 -0
  149. package/dist/core/inference/text-inference.js +173 -0
  150. package/dist/core/interaction-registration.js +10 -0
  151. package/dist/core/interaction-router.js +278 -0
  152. package/dist/core/message/create-status.js +67 -0
  153. package/dist/core/message/im-renderer.js +659 -0
  154. package/dist/core/message/items-formatter.js +76 -0
  155. package/dist/core/message/logical-queue-bridge.js +123 -0
  156. package/dist/core/message/message-bridge.js +874 -0
  157. package/dist/core/message/message-cache.js +56 -0
  158. package/dist/core/message/message-log.js +339 -0
  159. package/dist/core/message/message-processor.js +4 -0
  160. package/dist/core/message/message-queue.js +1446 -0
  161. package/dist/core/message/message-utils.js +76 -0
  162. package/dist/core/message/peer-mode.js +105 -0
  163. package/dist/core/message/pending-hints.js +232 -0
  164. package/dist/core/message/response-depth.js +33 -0
  165. package/dist/core/message/response-engine.js +4020 -0
  166. package/dist/core/message/response-snapshot.js +83 -0
  167. package/dist/core/message/send-receipt.js +24 -0
  168. package/dist/core/message/stream-debouncer.js +139 -0
  169. package/dist/core/message/stream-idle-monitor.js +124 -0
  170. package/dist/core/model/config-scope.js +162 -0
  171. package/dist/core/model/field-scope.js +78 -0
  172. package/dist/core/model/model-catalog.js +227 -0
  173. package/dist/core/model/model-diagnostics.js +182 -0
  174. package/dist/core/model/model-permission.js +90 -0
  175. package/dist/core/permission/approval-gateway.js +1017 -0
  176. package/dist/core/permission/ec-command-parser.js +347 -0
  177. package/dist/core/permission/execution-sandbox.js +16 -0
  178. package/dist/core/permission/index.js +6 -0
  179. package/dist/core/permission/mode.js +24 -0
  180. package/dist/core/permission/sandbox-runtime.js +265 -0
  181. package/dist/core/permission/tool-policy.js +1019 -0
  182. package/dist/core/permission/unix-socket-policy.js +99 -0
  183. package/dist/core/protected-paths.js +332 -0
  184. package/dist/core/relation/peer-identity.js +222 -0
  185. package/dist/core/relation/peer-key.js +1 -0
  186. package/dist/core/role/runtime-policy.js +141 -0
  187. package/dist/core/session/adapters/claude-session-file-adapter.js +218 -0
  188. package/dist/core/session/adapters/codex-session-file-adapter.js +333 -0
  189. package/dist/core/session/adapters/gemini-session-file-adapter.js +181 -0
  190. package/dist/core/session/session-file-adapter.js +7 -0
  191. package/dist/core/session/session-file-health.js +45 -0
  192. package/dist/core/session/session-fs-store.js +273 -0
  193. package/dist/core/session/session-key.js +24 -0
  194. package/dist/core/session/session-manager.js +1643 -0
  195. package/dist/core/session/session-mapper.js +100 -0
  196. package/dist/core/session/session-renew.js +314 -0
  197. package/dist/core/session/session-title.js +128 -0
  198. package/dist/core/session/session-turn-coordinator.js +205 -0
  199. package/dist/core/session/session-turns.js +67 -0
  200. package/dist/core/system-channels.js +29 -0
  201. package/dist/eck/baseagent-caps.js +18 -0
  202. package/dist/eck/detect.js +47 -0
  203. package/dist/eck/group-rules-sync.js +345 -0
  204. package/dist/eck/init.js +77 -0
  205. package/dist/eck/kit-renderer.js +359 -0
  206. package/dist/eck/manifest-engine.js +446 -0
  207. package/dist/eck/message-renderer.js +199 -0
  208. package/dist/eck/rules-loader.js +28 -0
  209. package/dist/index.js +2926 -4
  210. package/dist/ipc.js +777 -0
  211. package/dist/paths.js +262 -0
  212. package/dist/product.js +18 -0
  213. package/dist/response-system/context-builder.js +71 -0
  214. package/dist/response-system/coordinator.js +117 -0
  215. package/dist/response-system/decision-executor.js +86 -0
  216. package/dist/response-system/engines/v1/index.js +21 -0
  217. package/dist/response-system/engines/v1/interactive-flow.js +27 -0
  218. package/dist/response-system/engines/v1/proactive-flow.js +137 -0
  219. package/dist/response-system/engines/v1/types.js +1 -0
  220. package/dist/response-system/extensions.js +41 -0
  221. package/dist/response-system/index.js +6 -0
  222. package/dist/response-system/modes/index.js +7 -0
  223. package/dist/response-system/modes/single-session/index.js +72 -0
  224. package/dist/response-system/queues/fifo-queue.js +44 -0
  225. package/dist/response-system/queues/index.js +6 -0
  226. package/dist/response-system/queues/lifo-queue.js +42 -0
  227. package/dist/response-system/queues/priority-queue.js +63 -0
  228. package/dist/response-system/registry.js +97 -0
  229. package/dist/response-system/resolver.js +37 -0
  230. package/dist/response-system/selector.js +23 -0
  231. package/dist/response-system/types.js +7 -0
  232. package/dist/stats/billing.js +163 -0
  233. package/dist/stats/budget.js +93 -0
  234. package/dist/stats/db.js +403 -0
  235. package/dist/stats/eck-vars.js +89 -0
  236. package/dist/stats/index.js +11 -0
  237. package/dist/stats/normalizer.js +80 -0
  238. package/dist/stats/price-resolver.js +138 -0
  239. package/dist/stats/query.js +763 -0
  240. package/dist/stats/role-budget.js +168 -0
  241. package/dist/stats/writer.js +151 -0
  242. package/dist/trigger/anomaly-store.js +258 -0
  243. package/dist/trigger/audit.js +152 -0
  244. package/dist/trigger/event-source.js +119 -0
  245. package/dist/trigger/feedback.js +685 -0
  246. package/dist/trigger/history.js +290 -0
  247. package/dist/trigger/manager.js +294 -0
  248. package/dist/trigger/parser.js +595 -0
  249. package/dist/trigger/patch.js +155 -0
  250. package/dist/trigger/scheduler.js +1602 -0
  251. package/dist/trigger/script-executor.js +155 -0
  252. package/dist/trigger/state.js +145 -0
  253. package/dist/trigger/types.js +1 -0
  254. package/dist/trigger/validation.js +634 -0
  255. package/dist/types.js +12 -0
  256. package/dist/utils/aid-bind.js +313 -0
  257. package/dist/utils/atomic-write.js +95 -0
  258. package/dist/utils/avatar-upload.js +123 -0
  259. package/dist/utils/cross-platform.js +297 -0
  260. package/dist/utils/ecweb-utils.js +73 -0
  261. package/dist/utils/error-dict.json +153 -0
  262. package/dist/utils/error-utils.js +349 -0
  263. package/dist/utils/instance-registry.js +444 -0
  264. package/dist/utils/locale.js +21 -0
  265. package/dist/utils/log-writer.js +270 -0
  266. package/dist/utils/logger.js +89 -0
  267. package/dist/utils/markdown-to-plain-text.js +20 -0
  268. package/dist/utils/media-cache.js +274 -0
  269. package/dist/utils/model-prices.jsonl +20 -0
  270. package/dist/utils/npm-ops.js +210 -0
  271. package/dist/utils/process-introspect.js +133 -0
  272. package/dist/utils/process-tree-stats.js +271 -0
  273. package/dist/utils/project-path.js +74 -0
  274. package/dist/utils/restart-safety.js +31 -0
  275. package/dist/utils/stats.js +410 -0
  276. package/dist/utils/system-memory.js +62 -0
  277. package/dist/utils/tool-summary.js +284 -0
  278. package/dist/utils/welcome.js +268 -0
  279. package/kits/docs/GUIDE.md +20 -0
  280. package/kits/docs/INDEX.md +66 -0
  281. package/kits/docs/aun/CHEATSHEET.md +19 -0
  282. package/kits/docs/aun/SYNC_PROTOCOL.md +15 -0
  283. package/kits/docs/channels/aun.md +65 -0
  284. package/kits/docs/channels/feishu.md +56 -0
  285. package/kits/docs/context-assembly.md +366 -0
  286. package/kits/docs/eck_templates/GUIDE.template.md +22 -0
  287. package/kits/docs/eck_templates/INDEX.template.md +28 -0
  288. package/kits/docs/eck_templates/path-registry.template.md +33 -0
  289. package/kits/docs/eck_templates/runtime.template.md +19 -0
  290. package/kits/docs/evolcore/INDEX.md +68 -0
  291. package/kits/docs/evolcore/agent.md +77 -0
  292. package/kits/docs/evolcore/aid.md +52 -0
  293. package/kits/docs/evolcore/config.md +149 -0
  294. package/kits/docs/evolcore/contact.md +57 -0
  295. package/kits/docs/evolcore/ctl.md +46 -0
  296. package/kits/docs/evolcore/event.md +216 -0
  297. package/kits/docs/evolcore/fs-architecture.md +1215 -0
  298. package/kits/docs/evolcore/fs.md +110 -0
  299. package/kits/docs/evolcore/group-fs.md +17 -0
  300. package/kits/docs/evolcore/group-rules.md +226 -0
  301. package/kits/docs/evolcore/group.md +150 -0
  302. package/kits/docs/evolcore/model.md +50 -0
  303. package/kits/docs/evolcore/msg.md +136 -0
  304. package/kits/docs/evolcore/response.md +75 -0
  305. package/kits/docs/evolcore/rpc.md +37 -0
  306. package/kits/docs/evolcore/self-summary.md +29 -0
  307. package/kits/docs/evolcore/stats.md +83 -0
  308. package/kits/docs/evolcore/storage.md +50 -0
  309. package/kits/docs/evolcore/trigger.md +539 -0
  310. package/kits/docs/identity/AID_PROFILE_SPEC.md +26 -0
  311. package/kits/docs/identity/PATH_OPS.md +16 -0
  312. package/kits/docs/identity/ROLE_DETAIL.md +23 -0
  313. package/kits/docs/identity/identity-tools.md +26 -0
  314. package/kits/docs/path-registry.md +43 -0
  315. package/kits/docs/prompt-loading-architecture.md +266 -0
  316. package/kits/docs/venues/aun-group.md +45 -0
  317. package/kits/docs/venues/aun-private.md +10 -0
  318. package/kits/docs/venues/client-desktop.md +10 -0
  319. package/kits/docs/venues/client-mobile.md +10 -0
  320. package/kits/docs/venues/feishu-group.md +13 -0
  321. package/kits/docs/venues/feishu-private.md +9 -0
  322. package/kits/docs/venues/group.md +25 -0
  323. package/kits/docs/venues/private.md +10 -0
  324. package/kits/eck_manifest.auxiliary.json +43 -0
  325. package/kits/eck_manifest.json +203 -0
  326. package/kits/eck_message_manifest.json +63 -0
  327. package/kits/migrations/README-role-config-v4.md +32 -0
  328. package/kits/migrations/migrate-contact-book-v2.mjs +747 -0
  329. package/kits/migrations/migrate-role-config-v4.mjs +623 -0
  330. package/kits/migrations/migrate-role-config-v5.mjs +346 -0
  331. package/kits/migrations/rename-config-file.mjs +99 -0
  332. package/kits/rules/01-overview.md +142 -0
  333. package/kits/rules/02-navigation.md +76 -0
  334. package/kits/rules/03-identity.md +34 -0
  335. package/kits/rules/04-relation.md +59 -0
  336. package/kits/rules/05-venue.md +44 -0
  337. package/kits/rules/06-channel.md +59 -0
  338. package/kits/schemas/_meta.json +32 -0
  339. package/kits/schemas/agent-config.schema.1.json +177 -0
  340. package/kits/schemas/agent-config.schema.2.json +239 -0
  341. package/kits/schemas/agent-config.schema.3.json +119 -0
  342. package/kits/schemas/agent-config.schema.4.json +208 -0
  343. package/kits/schemas/agent-config.schema.5.json +326 -0
  344. package/kits/schemas/agent-config.schema.6.json +322 -0
  345. package/kits/schemas/contact-book.schema.1.json +36 -0
  346. package/kits/schemas/contact-book.schema.2.json +43 -0
  347. package/kits/schemas/daemon.schema.1.json +90 -0
  348. package/kits/schemas/defaults.schema.1.json +81 -0
  349. package/kits/schemas/menu-exec-schema-commands.md +208 -0
  350. package/kits/schemas/migrations/README.md +28 -0
  351. package/kits/schemas/relation-config.schema.1.json +158 -0
  352. package/kits/schemas/relation-config.schema.2.json +73 -0
  353. package/kits/schemas/relation-config.schema.3.json +50 -0
  354. package/kits/schemas/relation-config.schema.4.json +47 -0
  355. package/kits/schemas/relation-config.schema.5.json +47 -0
  356. package/kits/schemas/role-config.schema.1.json +201 -0
  357. package/kits/schemas/role-registry.schema.1.json +35 -0
  358. package/kits/schemas/single-session.schema.1.json +31 -0
  359. package/kits/templates/bootstrap-welcome.md +15 -0
  360. package/kits/templates/message-fragments/handoff-request-to-target.md +13 -0
  361. package/kits/templates/message-fragments/handoff-response-to-origin.md +10 -0
  362. package/kits/templates/message-fragments/inject-default.md +2 -0
  363. package/kits/templates/message-fragments/item.md +2 -0
  364. package/kits/templates/roles/admin.json +9 -0
  365. package/kits/templates/roles/member.json +41 -0
  366. package/kits/templates/roles/owner.json +9 -0
  367. package/kits/templates/roles/visitor.json +40 -0
  368. package/kits/templates/system-fragments/baseagent.md +14 -0
  369. package/kits/templates/system-fragments/bootstrap.md +16 -0
  370. package/kits/templates/system-fragments/channel.md +48 -0
  371. package/kits/templates/system-fragments/commands.md +28 -0
  372. package/kits/templates/system-fragments/identity.md +11 -0
  373. package/kits/templates/system-fragments/relation.md +19 -0
  374. package/kits/templates/system-fragments/session.md +53 -0
  375. package/kits/templates/system-fragments/venue.md +31 -0
  376. package/package.json +50 -15
  377. package/dist/index.d.ts +0 -7
  378. package/dist/index.d.ts.map +0 -1
  379. package/dist/index.js.map +0 -1
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "contact-book.schema.2.json",
4
+ "title": "ContactBook v2 (agents/{aid}/contact.json)",
5
+ "x-logical-name": "contact-book",
6
+ "x-scope": "contact",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": ["$schema_version", "contacts"],
10
+ "properties": {
11
+ "$schema_version": { "type": "number", "const": 2, "default": 2, "x-merge": "scalar" },
12
+ "contacts": {
13
+ "type": "object",
14
+ "x-merge": "dict",
15
+ "description": "AID 联系人字典;群和无 AID 对端不进入 Contact Book",
16
+ "propertyNames": {
17
+ "pattern": "^([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?\\.){2,}[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?$"
18
+ },
19
+ "additionalProperties": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "displayName": { "type": "string", "description": "显示名" },
24
+ "aliases": {
25
+ "type": "array",
26
+ "description": "跨渠道身份映射,格式 <channelKey>:<urlEncode(peerId)>",
27
+ "items": {
28
+ "type": "string",
29
+ "pattern": "^[A-Za-z0-9_-]+#([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?\\.){2,}[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?#[A-Za-z0-9_-]+:[^:]+$"
30
+ },
31
+ "uniqueItems": true
32
+ },
33
+ "status": {
34
+ "type": "string",
35
+ "enum": ["active", "blocked", "pending"],
36
+ "default": "active",
37
+ "description": "AID 联系状态;blocked 只阻断该 AID 的 AUN 私聊"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "daemon.schema.1.json",
4
+ "title": "ProcessConfig (daemon.json)",
5
+ "description": "进程级配置:daemon 自身运行配置,链外独立作用域,不进覆盖链。",
6
+ "x-logical-name": "daemon",
7
+ "x-scope": "process",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "$schema_version": { "type": "number", "default": 1, "x-merge": "scalar" },
12
+ "aid": { "type": "string", "description": "daemon 默认身份 AID", "x-merge": "scalar" },
13
+ "owners": {
14
+ "type": "array",
15
+ "items": { "type": "string" },
16
+ "description": "进程控制面鉴权名单(谁能远程管 daemon)",
17
+ "x-merge": "list"
18
+ },
19
+ "debug": {
20
+ "type": "object",
21
+ "description": "进程级调试配置",
22
+ "x-merge": "dict",
23
+ "properties": {
24
+ "eckSnapshots": {
25
+ "type": "boolean",
26
+ "default": false,
27
+ "description": "是否写入可能包含敏感上下文的 ECK 旁路调试快照"
28
+ }
29
+ }
30
+ },
31
+ "tunnel": {
32
+ "type": "object",
33
+ "description": "内网穿透配置",
34
+ "x-merge": "dict",
35
+ "properties": {
36
+ "targets": { "type": "array", "description": "穿透目标列表", "items": { "type": "object" } }
37
+ }
38
+ },
39
+ "aun": {
40
+ "type": "object",
41
+ "description": "keystore 加密种子等(值用 ${VAR} 引用)",
42
+ "x-merge": "dict",
43
+ "properties": {
44
+ "encryptionSeed": { "type": ["string", "null"], "description": "keystore 加密种子(用 ${VAR} 引用,勿明文)" }
45
+ }
46
+ },
47
+ "serviceProxy": {
48
+ "type": "object",
49
+ "description": "AUN Service Proxy:把本地服务暴露到 AUN 网络",
50
+ "x-merge": "dict",
51
+ "properties": {
52
+ "enabled": { "type": "boolean", "description": "是否启用 Service Proxy" },
53
+ "services": { "type": "array", "description": "暴露到 AUN 的本地服务列表", "items": { "type": "object" } }
54
+ }
55
+ },
56
+ "configSnapshots": {
57
+ "type": "boolean",
58
+ "default": true,
59
+ "description": "是否自动维护配置快照、启动日志和自检回落",
60
+ "x-merge": "scalar"
61
+ },
62
+ "idleMonitor": {
63
+ "type": "object",
64
+ "description": "流式输出空闲监控配置",
65
+ "x-merge": "dict",
66
+ "properties": {
67
+ "enabled": { "type": "boolean", "default": true, "description": "是否启用空闲监控" },
68
+ "timeout": { "type": "number", "default": 120, "description": "空闲超时秒数" },
69
+ "maxExecutionTime": { "type": "number", "default": 3600, "description": "单个任务总执行时限(秒),等待审批期间仍继续计时" }
70
+ }
71
+ },
72
+ "ecweb": {
73
+ "type": "object",
74
+ "description": "web 控制台开关/端口",
75
+ "x-merge": "dict",
76
+ "properties": {
77
+ "enabled": { "type": "boolean", "description": "是否启用 web 控制台" },
78
+ "port": { "type": "number", "description": "web 控制台监听端口" }
79
+ }
80
+ },
81
+ "watch": {
82
+ "type": "object",
83
+ "description": "日志监听配置",
84
+ "x-merge": "dict",
85
+ "properties": {
86
+ "logTypes": { "type": "array", "description": "要监听的日志类型", "items": { "type": "string" } }
87
+ }
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "defaults.schema.1.json",
4
+ "title": "DefaultsConfig (agents/defaults.json)",
5
+ "description": "全局默认配置。覆盖链最低层。",
6
+ "x-logical-name": "defaults",
7
+ "x-scope": "defaults",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "$schema_version": { "type": "number", "default": 1, "x-merge": "scalar" },
12
+ "models": {
13
+ "type": "object",
14
+ "description": "模型配置",
15
+ "x-merge": "dict",
16
+ "properties": {
17
+ "default": { "type": "string", "description": "全局默认模型" },
18
+ "allowed": {
19
+ "type": "array",
20
+ "items": { "type": "string" },
21
+ "description": "全局模型白名单"
22
+ }
23
+ }
24
+ },
25
+ "active_baseagent": {
26
+ "type": "string",
27
+ "description": "当前活跃的 base agent(claude/codex/gemini)。暂存于此,待权限体系实现后迁移。",
28
+ "x-merge": "scalar"
29
+ },
30
+ "baseagents": {
31
+ "type": "object",
32
+ "description": "各 base agent 配置(model/effort/apiKey/baseUrl 等)。暂存于此,待权限体系实现后迁移。",
33
+ "x-merge": "dict"
34
+ },
35
+ "projects": {
36
+ "type": "object",
37
+ "description": "项目路径配置",
38
+ "x-merge": "dict",
39
+ "properties": {
40
+ "rootPath": { "type": "string", "description": "全局项目根路径" },
41
+ "defaultPath": { "type": "string", "description": "全局默认项目路径" }
42
+ }
43
+ },
44
+ "aun": {
45
+ "type": "object",
46
+ "description": "全局 AUN 配置",
47
+ "x-merge": "dict",
48
+ "properties": {
49
+ "keystorePath": { "type": "string" },
50
+ "encryptionSeed": { "type": "string" },
51
+ "gatewayUrl": { "type": "string" }
52
+ }
53
+ },
54
+ "debug": {
55
+ "type": "object",
56
+ "description": "全局调试配置",
57
+ "x-merge": "dict",
58
+ "properties": {
59
+ "logLevel": { "type": "string", "enum": ["DEBUG", "INFO", "WARN", "ERROR"], "description": "日志级别", "x-enumDescriptions": { "DEBUG": "调试:最详细", "INFO": "信息:常规运行日志", "WARN": "警告:仅警告及以上", "ERROR": "错误:仅错误" } },
60
+ "flusherDiag": { "type": "boolean" },
61
+ "aunTrace": { "type": "boolean" },
62
+ "aunSdkLog": { "type": "boolean" },
63
+ "upmsg": { "type": "boolean" }
64
+ }
65
+ },
66
+ "responseMode": { "type": "string", "x-merge": "scalar" },
67
+ "config": { "type": "object", "x-merge": "dict" },
68
+ "session_renew": {
69
+ "type": "object",
70
+ "description": "会话超时后的续接判定策略,默认关闭",
71
+ "x-merge": "dict",
72
+ "additionalProperties": false,
73
+ "properties": {
74
+ "enabled": { "type": "boolean", "default": false, "description": "是否启用超时后的会话连续性判定" },
75
+ "after_hours": { "type": "number", "exclusiveMinimum": 0, "default": 24, "description": "距最后一条有效对话超过该小时数才触发判定" },
76
+ "effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "default": "low", "description": "续接判定的推理强度", "x-enumDescriptions": { "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
77
+ "fallback_action": { "type": "string", "enum": ["continue", "new"], "default": "continue", "description": "无法判定时的兜底动作", "x-enumDescriptions": { "continue": "继续沿用当前会话", "new": "开启新会话" } }
78
+ }
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,208 @@
1
+ # 通过 menu action exec 获取 Schema 的命令手册
2
+
3
+ > 面向前端(App / Web / Bot)通过 `menu.action name=cli action=exec` 远程执行 CLI,取回配置 schema 的**版本**与**内容**。
4
+ > 传输层、`menu.response` 配对、错误处理等通用机制见 [menu-protocol-cli-exec-frontend.md](./menu-protocol-cli-exec-frontend.md)。
5
+
6
+ 对应代码:`src/cli/config.ts` · `src/config/config-operation-service.ts`(`executeSchema`)· `src/config/schema-registry.ts`
7
+
8
+ ---
9
+
10
+ ## 0. 请求信封(所有命令通用)
11
+
12
+ 固定 `name: "cli"`、`action: "exec"`,命令通过 `args.argv` 数组传入(推荐,无注入风险):
13
+
14
+ ```jsonc
15
+ {
16
+ "type": "menu.action",
17
+ "id": "<唯一请求 id>",
18
+ "name": "cli",
19
+ "action": "exec",
20
+ "args": { "argv": [ /* ...见下方各命令... */ ] }
21
+ }
22
+ ```
23
+
24
+ 响应通过 `menu.response.id` 配对:
25
+
26
+ - 成功(命令跑完):`data = { exitCode, stdout, stderr, truncated, durationMs }`
27
+ - `exitCode === 0` 才算命令成功;`--format json` 时对 `stdout` 直接 `JSON.parse`。
28
+ - 失败(透传层拒绝,命令没跑):`error = { code, message }`。
29
+
30
+ > 逻辑 schema 名(`<name>`):`daemon` / `defaults` / `agent-config` / `relation-config` / `contact-book` / `single-session`。各名对应哪份配置见 [§6 配置 ↔ Schema 对应表](#6-配置--schema-对应表)。
31
+
32
+ ---
33
+
34
+ ## 1. 获取版本
35
+
36
+ ### 1.1 概览 —— 列出全部 schema 及各自当前版本
37
+
38
+ ```jsonc
39
+ // args.argv
40
+ ["config", "schema", "--format", "json"]
41
+ ```
42
+
43
+ `stdout`(`JSON.parse` 后):
44
+
45
+ ```jsonc
46
+ {
47
+ "ok": true,
48
+ "schemas": [
49
+ { "name": "daemon", "current": 1 },
50
+ { "name": "defaults", "current": 1 },
51
+ { "name": "agent-config", "current": 3 },
52
+ { "name": "relation-config", "current": 2 },
53
+ { "name": "contact-book", "current": 1 },
54
+ { "name": "single-session", "current": 1 }
55
+ ]
56
+ }
57
+ ```
58
+
59
+ ### 1.2 某个 schema 的全部磁盘版本(含当前标记 + 元信息)
60
+
61
+ ```jsonc
62
+ // args.argv —— 用 --list
63
+ ["config", "schema", "agent-config", "--list", "--format", "json"]
64
+ ```
65
+
66
+ `stdout`:
67
+
68
+ ```jsonc
69
+ {
70
+ "ok": true,
71
+ "name": "agent-config",
72
+ "current": 3, // 当前版本号
73
+ "versions": [
74
+ { "version": 1, "current": false, "date": "2026-06-14", "description": "..." },
75
+ { "version": 2, "current": false, "date": "2026-06-23", "description": "..." },
76
+ { "version": 3, "current": true, "date": "2026-07-08", "description": "..." }
77
+ ]
78
+ }
79
+ ```
80
+
81
+ > `date` / `description` 来自 schema history 元信息,可能缺省。
82
+
83
+ ---
84
+
85
+ ## 2. 获取 Schema 内容
86
+
87
+ ### 2.1 当前版本的完整定义(缺省版本号 = 当前版本)
88
+
89
+ ```jsonc
90
+ // args.argv
91
+ ["config", "schema", "agent-config", "--format", "json"]
92
+ ```
93
+
94
+ ### 2.2 指定版本的完整定义
95
+
96
+ ```jsonc
97
+ // args.argv —— 末尾追加版本号
98
+ ["config", "schema", "agent-config", "3", "--format", "json"]
99
+ ```
100
+
101
+ `stdout`(2.1 / 2.2 同结构):
102
+
103
+ ```jsonc
104
+ {
105
+ "ok": true,
106
+ "name": "agent-config",
107
+ "version": 3,
108
+ "current": true, // 该版本是否为当前版本
109
+ "content": { /* 完整 schema JSON(字段/类型/枚举/默认/x-merge 等) */ }
110
+ }
111
+ ```
112
+
113
+ ---
114
+
115
+ ## 3. 命令速查
116
+
117
+ | 目的 | `args.argv` |
118
+ |------|-------------|
119
+ | 列出全部 schema + 当前版本 | `["config","schema","--format","json"]` |
120
+ | 列出某 schema 的所有版本 | `["config","schema","<name>","--list","--format","json"]` |
121
+ | 查看某 schema 当前版本内容 | `["config","schema","<name>","--format","json"]` |
122
+ | 查看某 schema 指定版本内容 | `["config","schema","<name>","<version>","--format","json"]` |
123
+
124
+ 三种输出模式由参数决定:
125
+
126
+ | 调用形式 | `mode` | 输出 |
127
+ |----------|--------|------|
128
+ | `schema` | `overview` | 全部 schema + 各自当前版本号 |
129
+ | `schema <name> --list` | `versions` | 该 schema 所有磁盘版本,`current` 标当前,附 `date`/`description` |
130
+ | `schema <name> [version]` | `content` | 指定版本(缺省=当前)的完整 schema JSON |
131
+
132
+ ---
133
+
134
+ ## 4. 错误码
135
+
136
+ 命令自身失败(`data.exitCode != 0`,`stdout` 为 `{ "ok": false, "code": "...", "error": "..." }`):
137
+
138
+ | `code` | 触发场景 |
139
+ |--------|----------|
140
+ | `UNKNOWN_SCHEMA` | 未知 schema 名(`error` 会列出已知名) |
141
+ | `SCHEMA_VERSION_NOT_FOUND` | 版本不存在(`error` 会列出可用版本) |
142
+ | `INVALID_CONFIG_COMMAND` | `--list` 与 version 参数同时给出 |
143
+ | `MISSING_ARG` | `--list` 或指定 version 却未带 `<name>` |
144
+ | `INVALID_CONFIG_VALUE` | version 非非负整数 |
145
+
146
+ 透传层拒绝(`menu.response.error`,命令未执行):`NO_PERMISSION`(非 owner)、`NOT_ALLOWED`(命令不在白名单)、`MISSING_VALUE`、`NOT_SUPPORTED`(action 非 exec)、`TIMEOUT`(>15s)、`INTERNAL`。
147
+
148
+ > `config schema` 为纯只读操作,数据源为 schema-registry(读 `_meta.json` + 扫描 `kits/schemas/*.schema.*.json`),人和 agent 均可执行。
149
+
150
+ ---
151
+
152
+ ## 6. 配置 ↔ Schema 对应表
153
+
154
+ 每份配置文件由 `ConfigTarget` 路由到唯一的 schema(`src/config/config-manager.ts` 的 `TARGET_SCHEMA`)。查某份配置有哪些字段、类型/枚举/默认,就用 §2 拉对应 `<name>` 的内容。
155
+
156
+ | 配置层(scope) | ConfigTarget | 磁盘文件(相对 `$EVOLCORE_HOME`) | 逻辑 schema `<name>` | 当前版本 | 校验/说明 |
157
+ |---|---|---|---|---|---|
158
+ | 进程级 | `process` | `daemon.json` | `daemon` | 1 | 进程配置,启动时读取;改动需重启 daemon |
159
+ | 全局默认 | `defaults` | `agents/defaults.json` | `defaults` | 1 | 覆盖链最底层(`models.allowed` / `projects` / `aun` 等) |
160
+ | Agent 级 | `agent` | `agents/{aid}/config.json` | `agent-config` | 3 | 单 agent 全量参数;含 user role policy |
161
+ | 关系级 | `relation` | `agents/{aid}/relations/{peerKey}/config.json` | `relation-config` | 2 | 覆盖链最高优先;含 user/group role 分配 |
162
+ | 联系人簿 | `contact` | `agents/{aid}/contact.json` | `contact-book` | 1 | 跨渠道身份映射的联系人别名 |
163
+
164
+ **覆盖链优先级**(低 → 高,逐字段合并):`defaults` → `agent` → `relation`。
165
+
166
+ ### 响应模式桶 schema —— `single-session`
167
+
168
+ `single-session` 是**特殊 schema**:它不绑定任何独立配置文件,而是描述 `agent-config` / `relation-config` 里 `responseModeParams["single-session"]` 这个**桶**的形状(schema 根标记 `x-scope: "mode"`,区别于绑文件的 `process`/`agent`/`relation` 等)。它是 interactive / proactive 两模式合并为 `single-session` 后的模式特有参数容器。
169
+
170
+ - 主 config schema(`agent-config` / `relation-config`)把 `responseModeParams` 当黑箱 `{type: object}` 放行;
171
+ - 桶内部由「模式桶 schema」逐桶校验:桶键必须是已在 `_meta.json` 登记的响应模式名(如 `single-session`),校验逻辑见 `config-manager.ts` 的 `validateResponseModeParams`。
172
+ - 想看某响应模式桶能设哪些参数,就 `["config","schema","single-session","--format","json"]`。
173
+
174
+ **桶内参数**(`additionalProperties: false`,只允许下列键;均**仅 `chatmode=proactive` 时生效**):
175
+
176
+ | 字段 | 类型 | 默认 | 作用 |
177
+ |---|---|---|---|
178
+ | `pre_tool_1stmsgchk` | boolean | `true` | 首工具表态检查:首个工具调用前必须先向对端发消息/文件,否则拦截 |
179
+ | `tool_use_reminder` | boolean | `true` | 工具汇报提醒:启用队列未读提醒 + 每 10 次工具调用的汇报提醒 |
180
+
181
+ - schema 里的 `default` 即**运行时出厂默认**——宿主组装 `modeConfig` 时先铺这层默认(`coordinator.schemaDefaults`),再叠用户显式桶值;flow 层不再硬编码默认。
182
+ - `chatmode` 本身**不在此桶**:它由宿主按对端类型解析后强制注入 `modeConfig.chatmode`,与「选哪个模式」正交。
183
+ - 写入路径:`ec response set single-session ...` 或 `ec response config set <key> <value> --mode single-session --self <aid>`。经 menu exec 时把该 argv 传入即可。
184
+
185
+ > ⚠️ **存量迁移**:旧配置若把这两个键写在废弃的**顶层 `proactive` 块**下,读取时会被 `foldLegacyProactiveBlock` 就地折叠进 `responseModeParams["single-session"]` 桶(桶内已显式设的同名键优先,迁移值只补空缺),旧块随下次 write 从磁盘消失。未迁移的顶层旧键在运行时会**静默失效**——运行时只从桶里读。
186
+
187
+ > 每新增一个已实现的响应模式,就会多一份同名桶 schema。用 §1.1 概览命令看当前全部逻辑 schema。
188
+
189
+ ---
190
+
191
+ ## 5. 完整发送样例(AUN)
192
+
193
+ ```typescript
194
+ await client.call('message.send', {
195
+ to: targetAid,
196
+ payload: JSON.stringify({
197
+ type: 'menu.action',
198
+ id: 'c-schema-1',
199
+ name: 'cli',
200
+ action: 'exec',
201
+ args: { argv: ['config', 'schema', 'agent-config', '--format', 'json'] },
202
+ }),
203
+ encrypt: true,
204
+ });
205
+ // 响应在 onMessage 里按 parsed.id 配对:
206
+ // parsed.data.exitCode === 0 → JSON.parse(parsed.data.stdout).content
207
+ // parsed.error → 透传层拒绝
208
+ ```
@@ -0,0 +1,28 @@
1
+ # Schema 版本迁移函数
2
+
3
+ 每次某 schema 升版(`_meta.json` 里 currentVersion 上升)必须提供配套迁移函数。
4
+
5
+ ## 命名
6
+
7
+ ```
8
+ {schema}.{N}-to-{N+1}.ts
9
+ ```
10
+
11
+ 例:`agent-config.1-to-2.ts`。
12
+
13
+ ## 契约(整文件 in/out)
14
+
15
+ ```typescript
16
+ export function migrate(old: object): object; // 旧版本完整 JSON → 新版本完整 JSON
17
+ ```
18
+
19
+ - 入参/返回都是**完整对象**——整体重写,不做字段级 patch。
20
+ - 迁移产物直接覆盖原文件(ConfigManager 在迁移前已建 schema-migration 快照保证可回滚),写回后更新 `$schema_version`。
21
+ - 多版本串联即函数复合:`v1→v3 = migrate_2to3(migrate_1to2(old))`,逐版本串联,不跨版本直跳。
22
+
23
+ ## 要求
24
+
25
+ - 历史 schema 文件全部保留(`{逻辑名}.schema.{版本}.json`)。
26
+ - 每个迁移函数 default-export `migrate`,由 ConfigManager 动态 import。
27
+
28
+ 当前所有 schema 均为 v1,无迁移函数。
@@ -0,0 +1,158 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.1.json",
4
+ "title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
5
+ "description": "关系级配置——针对特定对端的个性化配置。覆盖链最高优先级。支持 29 个关系级参数。",
6
+ "x-logical-name": "relation-config",
7
+ "x-scope": "relation",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "$schema_version": {
12
+ "type": "number",
13
+ "default": 1,
14
+ "description": "Schema 版本号",
15
+ "x-merge": "scalar"
16
+ },
17
+ "models": {
18
+ "type": "object",
19
+ "description": "模型配置覆盖",
20
+ "x-merge": "dict",
21
+ "properties": {
22
+ "default": {
23
+ "type": "string",
24
+ "description": "默认模型(对不同用户可不同)"
25
+ }
26
+ }
27
+ },
28
+ "baseagents": {
29
+ "type": "object",
30
+ "description": "各 base agent 的 model/effort 等配置",
31
+ "x-merge": "dict",
32
+ "properties": {
33
+ "claude": {
34
+ "type": "object",
35
+ "properties": {
36
+ "model": { "type": "string", "description": "Claude 模型" },
37
+ "effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "description": "Claude 推理强度" },
38
+ "agentProgressSummaries": { "type": "boolean", "description": "Agent 进度摘要" },
39
+ "excludeDynamicSections": { "type": "boolean", "description": "排除动态章节" }
40
+ }
41
+ },
42
+ "codex": {
43
+ "type": "object",
44
+ "properties": {
45
+ "model": { "type": "string", "description": "Codex 模型" },
46
+ "effort": { "type": "string", "description": "Codex 推理强度" },
47
+ "enableRequestUserInput": { "type": "boolean", "description": "启用用户输入请求" },
48
+ "approvalsReviewer": { "type": "string", "enum": ["user", "auto_review", "guardian_subagent"], "description": "审批审查者" }
49
+ }
50
+ },
51
+ "gemini": {
52
+ "type": "object",
53
+ "properties": {
54
+ "model": { "type": "string", "description": "Gemini 模型" },
55
+ "mode": { "type": "string", "enum": ["cli", "sdk"], "description": "Gemini 模式" },
56
+ "useVertex": { "type": "boolean", "description": "是否使用 Vertex AI" }
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "chatmode": {
62
+ "type": "object",
63
+ "description": "对话模式:interactive=直接输出即回复;proactive=须显式发送",
64
+ "x-merge": "dict",
65
+ "properties": {
66
+ "private": { "type": "string", "enum": ["interactive", "proactive"], "description": "私聊对话模式" },
67
+ "group": { "type": "string", "enum": ["interactive", "proactive"], "description": "群聊对话模式" },
68
+ "nothuman": { "type": "string", "enum": ["interactive", "proactive"], "description": "非人类对话模式" }
69
+ }
70
+ },
71
+ "flush_delay": {
72
+ "type": "number",
73
+ "description": "消息 flush 间隔(秒),对不同用户可调整",
74
+ "x-merge": "scalar"
75
+ },
76
+ "debounce": {
77
+ "type": "number",
78
+ "description": "入站消息去抖间隔(秒)",
79
+ "x-merge": "scalar"
80
+ },
81
+ "dispatch": {
82
+ "type": "string",
83
+ "enum": ["mention", "broadcast"],
84
+ "description": "群聊分发策略",
85
+ "x-merge": "scalar"
86
+ },
87
+ "response_modes": {
88
+ "type": "object",
89
+ "description": "响应模式配置(关系级覆盖)。按第一层键合并",
90
+ "x-merge": "dict",
91
+ "properties": {
92
+ "default_private": { "type": "string", "description": "单聊默认响应模式 id" },
93
+ "default_group": { "type": "string", "description": "群聊默认响应模式 id" },
94
+ "configs": { "type": "object", "description": "各模式配置参数" },
95
+ "overrides": { "type": "object", "description": "按对端/群覆盖" }
96
+ }
97
+ },
98
+ "show_activities": {
99
+ "type": "string",
100
+ "enum": ["all", "text", "none"],
101
+ "description": "中间活动可见性(技术用户显示,普通用户隐藏)",
102
+ "x-merge": "scalar"
103
+ },
104
+ "enable_rich_content": {
105
+ "type": "boolean",
106
+ "description": "启用富内容渲染(对不同用户可定制)",
107
+ "x-merge": "scalar"
108
+ },
109
+ "proactive": {
110
+ "type": "object",
111
+ "description": "Proactive 模式细粒度策略",
112
+ "x-merge": "dict",
113
+ "properties": {
114
+ "pre_tool_1stmsgchk": {
115
+ "type": "boolean",
116
+ "description": "Proactive 下首次工具调用前必须先 send/file 表态"
117
+ },
118
+ "tool_use_reminder": {
119
+ "type": "boolean",
120
+ "description": "Proactive 下启用队列未读提醒和工具汇报提醒"
121
+ }
122
+ }
123
+ },
124
+ "render": {
125
+ "type": "object",
126
+ "description": "各渲染类型当前激活的 modeName",
127
+ "x-merge": "dict",
128
+ "properties": {
129
+ "private": { "type": "string", "description": "私聊渲染模式名称" },
130
+ "group": { "type": "string", "description": "群聊渲染模式名称" },
131
+ "inject": { "type": "string", "description": "注入渲染模式名称" }
132
+ }
133
+ },
134
+ "permissionMode": {
135
+ "type": "string",
136
+ "enum": ["auto", "bypass", "readonly", "request", "edit", "plan", "noask"],
137
+ "description": "执行权限模式(对信任用户 bypass,对陌生用户 readonly)",
138
+ "x-merge": "scalar"
139
+ },
140
+ "roles": {
141
+ "type": "object",
142
+ "description": "角色级行为覆盖:role → { baseagents, permissionMode }",
143
+ "x-merge": "dict",
144
+ "additionalProperties": {
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "properties": {
148
+ "baseagents": { "type": "object", "description": "角色级 baseagents 覆盖" },
149
+ "permissionMode": {
150
+ "type": "string",
151
+ "enum": ["auto", "bypass", "readonly", "request", "edit", "plan", "noask"],
152
+ "description": "角色级 permissionMode 覆盖"
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }