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,73 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.2.json",
4
+ "title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
5
+ "x-logical-name": "relation-config",
6
+ "x-scope": "relation",
7
+ "type": "object",
8
+ "additionalProperties": true,
9
+ "properties": {
10
+ "$schema_version": { "type": "number", "default": 2, "x-merge": "scalar" },
11
+ "active_baseagent": { "type": "string", "x-merge": "scalar" },
12
+ "models": { "type": "object", "x-merge": "dict" },
13
+ "baseagents": { "type": "object", "x-merge": "dict" },
14
+ "chatmode": { "type": "object", "x-merge": "dict", "properties": { "private": { "enum": ["interactive", "proactive"], "description": "人类私聊场景的投递方式", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "group": { "enum": ["interactive", "proactive"], "description": "群聊场景的投递方式", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "nothuman": { "enum": ["interactive", "proactive"], "description": "非人类(agent)私聊场景的投递方式", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } } }, "additionalProperties": false, "description": "chatmode 场景覆盖表;关系级按键覆盖 agent 级。键封闭 private/group/nothuman,值枚举 interactive/proactive" },
15
+ "mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "x-merge": "scalar", "description": "@ 处理策略(顶层通用参数);关系级不带 default,缺省继承 agent 级/schema 出厂值", "x-enumDescriptions": { "disabled": "处理所有消息", "mention-only": "只处理被 @ 的消息,未 @ 作引用上下文" } },
16
+ "model": { "type": "string", "x-merge": "scalar", "description": "主会话模型(顶层通用参数);关系级覆盖 agent 级" },
17
+ "responseMode": { "type": "string", "x-merge": "scalar", "description": "响应模式 id(标量);关系级覆盖 agent 级" },
18
+ "responseModeParams": { "type": "object", "x-merge": "dict", "description": "响应模式特有参数字典,按模式 id 分桶" },
19
+ "flush_delay": { "type": "number", "x-merge": "scalar" },
20
+ "debounce": { "type": "number", "x-merge": "scalar" },
21
+ "show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar", "description": "中间输出展示范围(仅对 interactive 私聊有意义)", "x-enumDescriptions": { "all": "文本 + activity", "text": "仅文本", "none": "全部静默" } },
22
+ "enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
23
+ "session_renew": {
24
+ "type": "object",
25
+ "x-merge": "dict",
26
+ "additionalProperties": false,
27
+ "description": "会话超时后的续接判定",
28
+ "properties": {
29
+ "enabled": { "type": "boolean", "description": "是否启用超时后的会话连续性判定" },
30
+ "after_hours": { "type": "number", "exclusiveMinimum": 0, "description": "距最后一条有效对话超过该小时数才触发判定" },
31
+ "effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "description": "续接判定的推理强度", "x-enumDescriptions": { "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
32
+ "fallback_action": { "type": "string", "enum": ["continue", "new"], "description": "无法判定时的兜底动作", "x-enumDescriptions": { "continue": "继续沿用当前会话", "new": "开启新会话" } }
33
+ }
34
+ },
35
+ "group_venue_sync": { "type": "object", "x-merge": "dict" },
36
+ "render": { "type": "object", "x-merge": "dict" },
37
+ "sessionManifests": { "type": "object", "x-merge": "dict" },
38
+ "permissionMode": {
39
+ "type": "string",
40
+ "enum": ["auto", "bypass", "readonly", "request", "edit", "plan", "noask"],
41
+ "x-merge": "scalar",
42
+ "description": "工具调用的审批策略",
43
+ "x-enumDescriptions": {
44
+ "auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝",
45
+ "bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批",
46
+ "readonly": "只读模式:明确只读工具自动执行,写入、普通 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权",
47
+ "request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批",
48
+ "edit": "历史值:运行时按 request 迁移",
49
+ "plan": "历史值:运行时按 readonly 迁移,并保留 Claude plan 工作流提示",
50
+ "noask": "历史值:运行时安全降级为 readonly"
51
+ }
52
+ },
53
+ "roles": {
54
+ "type": "object",
55
+ "x-merge": "dict",
56
+ "additionalProperties": false,
57
+ "properties": {
58
+ "assigned": {
59
+ "type": ["string", "null"],
60
+ "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$"
61
+ },
62
+ "members": {
63
+ "type": "object",
64
+ "additionalProperties": {
65
+ "type": ["string", "null"],
66
+ "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$"
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
72
+ }
73
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.3.json",
4
+ "title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
5
+ "x-logical-name": "relation-config",
6
+ "x-scope": "relation",
7
+ "type": "object",
8
+ "additionalProperties": true,
9
+ "properties": {
10
+ "$schema_version": { "type": "number", "default": 3, "x-merge": "scalar" },
11
+ "targetKind": { "type": "string", "enum": ["private", "group"], "x-merge": "scalar" },
12
+ "active_baseagent": { "type": "string", "x-merge": "scalar" },
13
+ "models": { "type": "object", "x-merge": "dict" },
14
+ "baseagents": { "type": "object", "x-merge": "dict" },
15
+ "chatmode": { "type": "object", "x-merge": "dict", "properties": { "private": { "enum": ["interactive", "proactive"] }, "group": { "enum": ["interactive", "proactive"] }, "nothuman": { "enum": ["interactive", "proactive"] } }, "additionalProperties": false },
16
+ "mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "x-merge": "scalar" },
17
+ "model": { "type": "string", "x-merge": "scalar" },
18
+ "responseMode": { "type": "string", "x-merge": "scalar" },
19
+ "responseModeParams": { "type": "object", "x-merge": "dict" },
20
+ "flush_delay": { "type": "number", "x-merge": "scalar" },
21
+ "debounce": { "type": "number", "x-merge": "scalar" },
22
+ "show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar" },
23
+ "enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
24
+ "session_renew": {
25
+ "type": "object",
26
+ "x-merge": "dict",
27
+ "additionalProperties": false,
28
+ "properties": {
29
+ "enabled": { "type": "boolean" },
30
+ "after_hours": { "type": "number", "exclusiveMinimum": 0 },
31
+ "effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"] },
32
+ "fallback_action": { "type": "string", "enum": ["continue", "new"] }
33
+ }
34
+ },
35
+ "group_venue_sync": { "type": "object", "x-merge": "dict" },
36
+ "render": { "type": "object", "x-merge": "dict" },
37
+ "sessionManifests": { "type": "object", "x-merge": "dict" },
38
+ "permissionMode": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "x-merge": "scalar", "description": "工具调用权限模式;历史 edit/plan/noask 在运行时安全迁移" },
39
+ "roles": {
40
+ "type": "object",
41
+ "x-merge": "dict",
42
+ "additionalProperties": false,
43
+ "properties": {
44
+ "assigned": { "type": ["string", "null"], "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$" },
45
+ "members": { "type": "object", "additionalProperties": { "type": ["string", "null"], "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$" } }
46
+ }
47
+ },
48
+ "extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
49
+ }
50
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.4.json",
4
+ "title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
5
+ "x-logical-name": "relation-config",
6
+ "x-scope": "relation",
7
+ "type": "object",
8
+ "additionalProperties": true,
9
+ "not": {
10
+ "anyOf": [
11
+ { "required": ["permissionMode"] },
12
+ { "required": ["roles"] }
13
+ ]
14
+ },
15
+ "properties": {
16
+ "$schema_version": { "type": "number", "default": 4, "x-merge": "scalar" },
17
+ "targetKind": { "type": "string", "enum": ["private", "group"], "x-merge": "scalar" },
18
+ "role": { "type": ["string", "null"], "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$", "x-merge": "scalar" },
19
+ "active_baseagent": { "type": "string", "x-merge": "scalar" },
20
+ "models": { "type": "object", "x-merge": "dict" },
21
+ "baseagents": { "type": "object", "x-merge": "dict" },
22
+ "chatmode": { "type": "object", "x-merge": "dict", "properties": { "private": { "enum": ["interactive", "proactive"] }, "group": { "enum": ["interactive", "proactive"] }, "nothuman": { "enum": ["interactive", "proactive"] } }, "additionalProperties": false },
23
+ "mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "x-merge": "scalar" },
24
+ "model": { "type": "string", "x-merge": "scalar" },
25
+ "responseMode": { "type": "string", "x-merge": "scalar" },
26
+ "responseModeParams": { "type": "object", "x-merge": "dict" },
27
+ "flush_delay": { "type": "number", "x-merge": "scalar" },
28
+ "debounce": { "type": "number", "x-merge": "scalar" },
29
+ "show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar" },
30
+ "enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
31
+ "session_renew": {
32
+ "type": "object",
33
+ "x-merge": "dict",
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "enabled": { "type": "boolean" },
37
+ "after_hours": { "type": "number", "exclusiveMinimum": 0 },
38
+ "effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"] },
39
+ "fallback_action": { "type": "string", "enum": ["continue", "new"] }
40
+ }
41
+ },
42
+ "group_venue_sync": { "type": "object", "x-merge": "dict" },
43
+ "render": { "type": "object", "x-merge": "dict" },
44
+ "sessionManifests": { "type": "object", "x-merge": "dict" },
45
+ "extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.5.json",
4
+ "title": "RelationConfig v5 (agents/{aid}/relations/{peerKey}/config.json)",
5
+ "x-logical-name": "relation-config",
6
+ "x-scope": "relation",
7
+ "type": "object",
8
+ "additionalProperties": true,
9
+ "not": {
10
+ "anyOf": [
11
+ { "required": ["permissionMode"] },
12
+ { "required": ["roles"] }
13
+ ]
14
+ },
15
+ "properties": {
16
+ "$schema_version": { "type": "number", "const": 5, "default": 5, "x-merge": "scalar" },
17
+ "targetKind": { "type": "string", "enum": ["private", "group"], "x-merge": "scalar" },
18
+ "role": { "type": ["string", "null"], "pattern": "^(?!owner$)[a-z0-9_-]+$", "x-merge": "scalar", "description": "关系角色;允许 admin/member/visitor/自定义角色,禁止 owner" },
19
+ "active_baseagent": { "type": "string", "x-merge": "scalar" },
20
+ "models": { "type": "object", "x-merge": "dict" },
21
+ "baseagents": { "type": "object", "x-merge": "dict" },
22
+ "chatmode": { "type": "object", "x-merge": "dict", "properties": { "private": { "enum": ["interactive", "proactive"] }, "group": { "enum": ["interactive", "proactive"] }, "nothuman": { "enum": ["interactive", "proactive"] } }, "additionalProperties": false },
23
+ "mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "x-merge": "scalar" },
24
+ "model": { "type": "string", "x-merge": "scalar" },
25
+ "responseMode": { "type": "string", "x-merge": "scalar" },
26
+ "responseModeParams": { "type": "object", "x-merge": "dict" },
27
+ "flush_delay": { "type": "number", "x-merge": "scalar" },
28
+ "debounce": { "type": "number", "x-merge": "scalar" },
29
+ "show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar" },
30
+ "enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
31
+ "session_renew": {
32
+ "type": "object",
33
+ "x-merge": "dict",
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "enabled": { "type": "boolean" },
37
+ "after_hours": { "type": "number", "exclusiveMinimum": 0 },
38
+ "effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"] },
39
+ "fallback_action": { "type": "string", "enum": ["continue", "new"] }
40
+ }
41
+ },
42
+ "group_venue_sync": { "type": "object", "x-merge": "dict" },
43
+ "render": { "type": "object", "x-merge": "dict" },
44
+ "sessionManifests": { "type": "object", "x-merge": "dict" },
45
+ "extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
46
+ }
47
+ }
@@ -0,0 +1,201 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "role-config.schema.1.json",
4
+ "title": "RoleConfig (agents/{aid}/roles/{roleId}.json)",
5
+ "description": "单个角色的独立策略配置。角色 ID 由文件名表达,本文件定义访问权限、行为字段约束、命令权限和用量额度。",
6
+ "x-logical-name": "role-config",
7
+ "x-scope": "role",
8
+ "x-permission-fields": [
9
+ { "value": "permissionMode", "label": "Permission Mode", "description": "角色的工具调用审批模式;只能由角色策略决定,关系级不可覆盖。", "valueType": "enum", "hasOptions": true, "relationOverrideApplied": false, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "static-enum", "options": [{ "value": "readonly", "label": "Readonly" }, { "value": "auto", "label": "Auto" }, { "value": "request", "label": "Request" }, { "value": "bypass", "label": "Bypass" }] },
10
+ { "value": "chatmode.private", "label": "Private Chat Mode", "description": "角色在私聊场景中的响应方式策略。", "valueType": "enum", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "static-enum", "options": [{ "value": "interactive", "label": "Interactive" }, { "value": "proactive", "label": "Proactive" }] },
11
+ { "value": "chatmode.group", "label": "Group Chat Mode", "description": "角色在群聊场景中的响应方式策略。", "valueType": "enum", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "static-enum", "options": [{ "value": "interactive", "label": "Interactive" }, { "value": "proactive", "label": "Proactive" }] },
12
+ { "value": "mentionMode", "label": "Group Mention Mode", "description": "角色在群聊场景中的提及响应策略。", "valueType": "enum", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "static-enum", "options": [{ "value": "disabled", "label": "Disabled" }, { "value": "mention-only", "label": "Mention Only" }] },
13
+ { "value": "baseagents.claude.model", "label": "Claude Model", "description": "角色可使用的 Claude 默认模型和模型白名单。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "model-catalog", "patterns": [{ "value": "*", "label": "All Claude models" }, { "value": "claude-opus-*", "label": "Claude Opus family" }, { "value": "claude-sonnet-*", "label": "Claude Sonnet family" }, { "value": "claude-haiku-*", "label": "Claude Haiku family" }] },
14
+ { "value": "baseagents.claude.effort", "label": "Claude Effort", "description": "角色使用 Claude 时的默认推理强度及可覆盖范围。", "valueType": "enum", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "static-enum", "options": [{ "value": "auto", "label": "Auto" }, { "value": "low", "label": "Low" }, { "value": "medium", "label": "Medium" }, { "value": "high", "label": "High" }, { "value": "xhigh", "label": "Xhigh" }, { "value": "max", "label": "Max" }] },
15
+ { "value": "baseagents.codex.model", "label": "Codex Model", "description": "角色可使用的 Codex 默认模型和模型白名单。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "model-catalog", "patterns": [{ "value": "*", "label": "All Codex models" }, { "value": "gpt-5.4*", "label": "GPT-5.4 family" }, { "value": "gpt-5.3-codex*", "label": "GPT-5.3 Codex family" }] },
16
+ { "value": "baseagents.codex.reasoning", "label": "Codex Reasoning", "description": "角色使用 Codex 时的默认推理强度及可覆盖范围。", "valueType": "enum", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "static-enum", "options": [{ "value": "auto", "label": "Auto" }, { "value": "low", "label": "Low" }, { "value": "medium", "label": "Medium" }, { "value": "high", "label": "High" }, { "value": "xhigh", "label": "Xhigh" }] },
17
+ { "value": "baseagents.gemini.model", "label": "Gemini Model", "description": "角色可使用的 Gemini 默认模型和模型白名单。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "model-catalog", "patterns": [{ "value": "*", "label": "All Gemini models" }, { "value": "gemini-*", "label": "Gemini model family" }] },
18
+ { "value": "baseagents.hermes.model", "label": "Hermes Model", "description": "角色可使用的 Hermes 默认模型和模型白名单。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "model-catalog", "patterns": [{ "value": "*", "label": "All Hermes models" }] }
19
+ ],
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["$schema_version", "description", "permissions"],
23
+ "properties": {
24
+ "$schema_version": { "type": "number", "const": 1, "default": 1, "description": "角色配置 Schema 版本,固定为 1。" },
25
+ "description": { "type": "string", "description": "角色的用途、信任级别和授权边界说明。" },
26
+ "rank": { "type": "integer", "enum": [100, 300, 500, 700, 900], "description": "角色排序系数;内置角色固定,自定义角色固定为 500。旧文件缺省时由角色加载器补齐。" },
27
+ "allowAccess": { "type": "boolean", "default": true, "description": "是否允许该角色访问 Agent;缺省为 true。" },
28
+ "permissions": {
29
+ "type": "object",
30
+ "required": ["permissionMode"],
31
+ "description": "角色对运行时行为字段施加的默认值、关系级覆盖权及候选值约束。",
32
+ "properties": {
33
+ "permissionMode": {
34
+ "type": "object",
35
+ "required": ["default", "allowOverride"],
36
+ "additionalProperties": false,
37
+ "description": "工具调用审批模式策略;该策略必须存在且不允许关系级覆盖。",
38
+ "properties": {
39
+ "default": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "该角色实际使用的工具调用审批模式。", "x-enumDescriptions": { "readonly": "只读模式:明确只读工具自动执行,写入、普通 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权", "auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝", "request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批", "bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批" } },
40
+ "allowOverride": { "const": false, "default": false, "description": "权限模式禁止关系级覆盖,固定为 false。" },
41
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "一个可列入权限模式候选集合的值。", "x-enumDescriptions": { "readonly": "只读模式", "auto": "自动模式", "request": "请求人工审批模式", "bypass": "受强制危险规则约束的放行模式" } }, "uniqueItems": true, "description": "保留的权限模式候选集合;permissionMode 当前不可由关系级覆盖,通常无需配置。" },
42
+ "reason": { "type": "string", "description": "采用该权限模式策略的可审计原因或管理备注。" }
43
+ }
44
+ },
45
+ "chatmode.private": {
46
+ "type": "object",
47
+ "required": ["default", "allowOverride"],
48
+ "additionalProperties": false,
49
+ "description": "该角色在私聊场景中的响应方式策略。",
50
+ "properties": {
51
+ "default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的私聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
52
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖私聊响应方式;缺省为 false。" },
53
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive"], "description": "一个可用于私聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "uniqueItems": true, "description": "允许关系级覆盖到的私聊响应方式白名单;若提供,必须包含 default。" },
54
+ "reason": { "type": "string", "description": "采用该私聊响应策略的可审计原因或管理备注。" }
55
+ }
56
+ },
57
+ "chatmode.group": {
58
+ "type": "object",
59
+ "required": ["default", "allowOverride"],
60
+ "additionalProperties": false,
61
+ "description": "该角色在群聊场景中的响应方式策略。",
62
+ "properties": {
63
+ "default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的群聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
64
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊响应方式;缺省为 false。" },
65
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive"], "description": "一个可用于群聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊响应方式白名单;若提供,必须包含 default。" },
66
+ "reason": { "type": "string", "description": "采用该群聊响应策略的可审计原因或管理备注。" }
67
+ }
68
+ },
69
+ "mentionMode": {
70
+ "type": "object",
71
+ "required": ["default", "allowOverride"],
72
+ "additionalProperties": false,
73
+ "description": "该角色在群聊场景中的提及响应策略。",
74
+ "properties": {
75
+ "default": { "type": "string", "enum": ["disabled", "mention-only"], "description": "未设置有效关系级覆盖时使用的群聊提及响应策略。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应" } },
76
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊提及响应策略;缺省为 false。" },
77
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["disabled", "mention-only"], "description": "一个可用于群聊提及响应策略覆盖的值。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊提及响应策略白名单;若提供,必须包含 default。" },
78
+ "reason": { "type": "string", "description": "采用该群聊提及响应策略的可审计原因或管理备注。" }
79
+ }
80
+ },
81
+ "baseagents.claude.effort": {
82
+ "type": "object",
83
+ "required": ["default", "allowOverride"],
84
+ "additionalProperties": false,
85
+ "description": "该角色使用 Claude runner 时的推理强度策略。",
86
+ "properties": {
87
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 Claude 推理强度。", "x-enumDescriptions": { "auto": "由 Claude runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
88
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Claude 推理强度;缺省为 false。" },
89
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "一个允许覆盖到的 Claude 推理强度。", "x-enumDescriptions": { "auto": "由 Claude runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } }, "uniqueItems": true, "description": "允许关系级覆盖到的 Claude 推理强度白名单;若提供,必须包含 default。" },
90
+ "reason": { "type": "string", "description": "采用该 Claude 推理强度策略的可审计原因或管理备注。" }
91
+ }
92
+ },
93
+ "baseagents.codex.reasoning": {
94
+ "type": "object",
95
+ "required": ["default", "allowOverride"],
96
+ "additionalProperties": false,
97
+ "description": "该角色使用 Codex runner 时的推理强度策略。",
98
+ "properties": {
99
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh"], "description": "角色默认的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高" } },
100
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Codex 推理强度;缺省为 false。" },
101
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh"], "description": "一个允许覆盖到的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高" } }, "uniqueItems": true, "description": "允许关系级覆盖到的 Codex 推理强度白名单;若提供,必须包含 default。" },
102
+ "reason": { "type": "string", "description": "采用该 Codex 推理强度策略的可审计原因或管理备注。" }
103
+ }
104
+ }
105
+ },
106
+ "patternProperties": {
107
+ "^baseagents\\.[a-z0-9_-]+\\.model$": {
108
+ "type": "object",
109
+ "required": ["default", "allowOverride", "allowedModels"],
110
+ "additionalProperties": false,
111
+ "description": "指定 base agent 的角色模型策略;默认模型必须匹配 allowedModels。",
112
+ "properties": {
113
+ "default": { "type": "string", "minLength": 1, "description": "该角色默认使用的模型标识;必须被 allowedModels 中的精确值或通配符允许。" },
114
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖模型;缺省为 false。" },
115
+ "allowedModels": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "description": "一个允许使用的模型标识或以 * 表达的通配符模式。" }, "uniqueItems": true, "description": "该角色可用的模型白名单;支持通配符,且至少包含一个条目。" },
116
+ "reason": { "type": "string", "description": "采用该角色模型策略的可审计原因或管理备注。" }
117
+ }
118
+ }
119
+ },
120
+ "additionalProperties": false
121
+ },
122
+ "commandPermissions": {
123
+ "type": "object",
124
+ "x-optionsSource": "operation-catalog",
125
+ "description": "按 operation 标识定义角色的命令执行权限;候选 operation 来自运行时 operation catalog。",
126
+ "propertyNames": { "type": "string", "minLength": 1, "description": "非空 operation 标识,支持精确名称及系统识别的通配规则。" },
127
+ "additionalProperties": {
128
+ "type": "object",
129
+ "required": ["allow"],
130
+ "additionalProperties": false,
131
+ "description": "一个 operation 的角色授权规则。",
132
+ "properties": {
133
+ "allow": { "type": "boolean", "description": "是否允许该角色执行匹配的 operation。" },
134
+ "dangerous": { "type": "boolean", "default": false, "description": "是否将该授权规则标记为危险操作规则;危险操作还会应用额外安全约束。" },
135
+ "scopes": {
136
+ "type": "array",
137
+ "items": { "type": "string", "enum": ["relation", "role", "agent", "process", "filesystem", "control", "raw-cli"], "description": "该命令权限适用的一个配置或执行作用域。", "x-enumDescriptions": { "relation": "当前 Agent 与对端的关系配置域", "role": "独立角色注册表或角色策略配置域", "agent": "单个 Agent 的配置与生命周期域", "process": "EvolCore 进程级配置与运行域", "filesystem": "受控文件系统操作域", "control": "控制面命令和管理通道域", "raw-cli": "未经结构化 operation 封装的原始 CLI 执行域" } },
138
+ "uniqueItems": true,
139
+ "description": "该授权规则允许生效的作用域白名单;未配置时由 operation 自身和鉴权器决定。"
140
+ },
141
+ "constraints": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "description": "operation 级附加约束,例如对端、Agent、群聊、控制通道、参数或工作目录限制。",
145
+ "properties": {
146
+ "ownPeerOnly": { "type": "boolean" },
147
+ "ownAgentOnly": { "type": "boolean" },
148
+ "targetCurrentAgentOnly": { "type": "boolean" },
149
+ "requireAgentAdmin": { "type": "boolean" },
150
+ "requireAgentOwner": { "type": "boolean" },
151
+ "privateOnly": { "type": "boolean" },
152
+ "groupOnly": { "type": "boolean" },
153
+ "requireDaemonOwner": { "type": "boolean" },
154
+ "requireControlChannel": { "type": "boolean" },
155
+ "requireExplicitDangerousGrant": { "type": "boolean" },
156
+ "currentRelationOnly": { "type": "boolean" },
157
+ "requireFieldOverride": { "type": "string", "minLength": 1 },
158
+ "configFieldPolicy": { "type": "string", "enum": ["behavior-read", "role-overridable-write"] },
159
+ "allowedArgs": { "$ref": "#/definitions/argumentConstraints" },
160
+ "deniedArgs": { "$ref": "#/definitions/argumentConstraints" },
161
+ "forbiddenFlags": { "$ref": "#/definitions/stringList" },
162
+ "allowedConfigKeys": { "$ref": "#/definitions/stringList" },
163
+ "allowedPrefixes": { "$ref": "#/definitions/stringList" },
164
+ "timeoutMs": { "type": "integer", "minimum": 0 },
165
+ "outputLimitBytes": { "type": "integer", "minimum": 0 },
166
+ "cwdPolicy": { "type": "string", "enum": ["agentProject", "evolcoreHome", "none"] },
167
+ "envAllowlist": { "$ref": "#/definitions/stringList" }
168
+ }
169
+ },
170
+ "reason": { "type": "string", "description": "采用该命令权限规则的可审计原因或管理备注。" }
171
+ }
172
+ }
173
+ },
174
+ "usageLimits": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "description": "角色用量额度策略;enabled 未开启或未配置时不启用额度限制。",
178
+ "properties": {
179
+ "enabled": { "type": "boolean", "default": false, "description": "是否启用该角色的用量额度限制;缺省为 false。" },
180
+ "resetMode": { "type": "string", "enum": ["never", "daily", "weekly", "monthly"], "description": "用量额度的重置周期。", "x-enumDescriptions": { "never": "累计额度,从不自动重置", "daily": "每日重置", "weekly": "每周重置", "monthly": "每月重置" } },
181
+ "currency": { "type": "string", "enum": ["CNY", "USD"], "description": "额度金额使用的计价货币。", "x-enumDescriptions": { "CNY": "人民币", "USD": "美元" } },
182
+ "limitAmount": { "type": ["number", "null"], "minimum": 0, "description": "额度上限金额;非负数表示上限,null 表示不限。" },
183
+ "costBasis": { "type": "string", "enum": ["gateway", "official"], "description": "额度统计采用的模型计费口径。", "x-enumDescriptions": { "gateway": "按实际网关计费价统计", "official": "按模型提供商官方定价统计" } },
184
+ "scope": { "type": "string", "enum": ["subject", "role"], "description": "额度累计和重置的统计范围。", "x-enumDescriptions": { "subject": "按对端主体分别统计", "role": "同一角色的所有主体共享统计" } }
185
+ }
186
+ }
187
+ },
188
+ "definitions": {
189
+ "stringList": {
190
+ "type": "array",
191
+ "items": { "type": "string" }
192
+ },
193
+ "argumentConstraints": {
194
+ "type": "object",
195
+ "additionalProperties": {
196
+ "type": "array",
197
+ "items": { "type": ["string", "number", "boolean"] }
198
+ }
199
+ }
200
+ }
201
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "role-registry.schema.1.json",
4
+ "title": "RoleRegistry (agents/{aid}/roles/index.json)",
5
+ "description": "Agent 的角色注册表。声明可加载的角色 ID,并配置未显式分配角色时私聊和群聊使用的默认角色。",
6
+ "x-logical-name": "role-registry",
7
+ "x-scope": "role",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": ["$schema_version", "roles", "defaultRoles"],
11
+ "properties": {
12
+ "$schema_version": { "type": "number", "const": 1, "default": 1, "x-merge": "scalar", "description": "角色注册表 Schema 版本,固定为 1。" },
13
+ "roles": {
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "uniqueItems": true,
17
+ "contains": { "const": "visitor", "description": "注册表必须包含 visitor,以保证始终存在低权限安全回退角色。" },
18
+ "items": { "type": "string", "pattern": "^[a-z0-9_-]+$", "description": "一个已注册角色 ID;对应 roles/{roleId}.json 或同名内置模板。" },
19
+ "x-merge": "list",
20
+ "description": "允许加载、展示和分配的角色 ID 列表;未注册的角色文件不产生运行时权限。"
21
+ },
22
+ "defaultRoles": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["private", "group"],
26
+ "default": { "private": null, "group": null },
27
+ "description": "未显式分配角色时,私聊和群聊分别采用的默认角色;null 表示不自动授予角色。",
28
+ "properties": {
29
+ "private": { "type": ["string", "null"], "pattern": "^(?!owner$)[a-z0-9_-]+$", "default": null, "description": "私聊默认角色;必须已注册且不能为 owner。" },
30
+ "group": { "type": ["string", "null"], "pattern": "^(?!owner$)[a-z0-9_-]+$", "default": null, "description": "群聊默认角色;必须已注册且不能为 owner。" }
31
+ },
32
+ "x-merge": "dict"
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "single-session.schema.1.json",
4
+ "title": "SingleSessionParams (responseModeParams['single-session'])",
5
+ "x-logical-name": "single-session",
6
+ "x-scope": "mode",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "pre_tool_1stmsgchk": {
11
+ "type": "boolean",
12
+ "enum": [true, false],
13
+ "default": true,
14
+ "description": "proactive 首工具表态检查(仅 chatmode=proactive 生效):首个工具调用前必须先向对端表态,否则拦截。",
15
+ "x-enumDescriptions": {
16
+ "true": "启用:首工具前必须先发送消息或文件",
17
+ "false": "禁用:允许直接调用工具"
18
+ }
19
+ },
20
+ "tool_use_reminder": {
21
+ "type": "boolean",
22
+ "enum": [true, false],
23
+ "default": true,
24
+ "description": "proactive 工具汇报提醒(仅 chatmode=proactive 生效):启用队列未读提醒 + 每 10 次工具调用的汇报提醒。",
25
+ "x-enumDescriptions": {
26
+ "true": "启用:自动汇报工具使用情况",
27
+ "false": "禁用:静默执行工具"
28
+ }
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,15 @@
1
+ 你好,我是 {{agentName}}。
2
+
3
+ 我刚刚完成连接,需要先和你确认我的基础信息,然后再进入正常工作状态。
4
+
5
+ 请帮我确认三项内容:
6
+ 1. 显示名:你希望我叫什么?
7
+ 2. 简介:我主要负责什么?一句到两句话即可。
8
+ 3. 标签:给我 3 到 6 个标签,例如 `代码审查`、`客服助手`、`项目管理`。
9
+
10
+ 当前信息:
11
+ - AID: {{agentAid}}
12
+ - 渠道: {{channel}}
13
+ - Baseagent: {{baseagent}}
14
+
15
+ 你可以直接按上面的三项回复。
@@ -0,0 +1,13 @@
1
+ 说明:
2
+ - 跨会话请求回复,仅本端可见。
3
+ - 请结合下方内容理解当前对端回复。
4
+ - 当前回流策略:{{handoffReturnPolicy}}
5
+ - 若策略为 required 且当前回复足以处理请求,使用:`ec handoff return {{handoffId}} "<完整回流内容>"`
6
+ - 若策略为 none 且当前回复已处理请求,使用:`ec handoff return {{handoffId}}`
7
+ - 若回复不足,不要执行 return。
8
+
9
+ 此前发给当前对端的内容:
10
+ {{handoffPreviousContent}}
11
+
12
+ 当前对端回复内容:
13
+ {{content}}
@@ -0,0 +1,10 @@
1
+ 说明:
2
+ - 跨会话结果回流,仅本端可见。
3
+ - 这是此前本会话请求的返回结果,请结合当前上下文回复当前对端。
4
+ - 不要提及 handoff 或内部路由机制。
5
+
6
+ 此前跨会话请求内容:
7
+ {{handoffPreviousContent}}
8
+
9
+ 回流内容:
10
+ {{content}}
@@ -0,0 +1,2 @@
1
+ ‹owner 提示 · 已验证 · {{injectTime}}{{?ownerAid}} · from:{{ownerAid}}{{/}}›(仅你可见,对端无感;请据此决定如何回复对端)
2
+ {{content}}
@@ -0,0 +1,2 @@
1
+ ‹{{now}} · from:{{peerId}}{{?peerName}}({{peerName}}){{/}}{{?peerRole}} · role:{{peerRole}}{{/}}{{?chatType=group}} → 群:{{groupLabel}} · self:{{selfAid}}{{/}}{{?chatType=private}} → self:{{selfAid}}{{/}}{{?encrypted=true}} · 🔒密文{{/}}{{?encrypted=false}} · ✉️明文{{/}}{{?sameDevice}} · 📍同设备{{/}}{{?sameNetwork}} · 🌐同网络{{/}}{{?sameEgressIp}} · 🔀同出口IP{{/}}{{?mentionAids}} · @:{{mentionAids}}{{/}}›
2
+ {{content}}
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema_version": 1,
3
+ "description": "Agent administrator with guarded management authority",
4
+ "rank": 700,
5
+ "allowAccess": true,
6
+ "permissions": {
7
+ "permissionMode": { "default": "request", "allowOverride": false }
8
+ }
9
+ }