evolcore 0.0.23 → 0.0.25

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 (245) hide show
  1. package/CHANGELOG.md +583 -516
  2. package/LICENSE +21 -21
  3. package/README.md +455 -453
  4. package/bin/codex-managed-acl.ps1 +160 -155
  5. package/bin/codex-managed-hook.mjs +209 -92
  6. package/bin/ec-safe-output.js +327 -245
  7. package/bin/ec.js +29 -29
  8. package/bin/install-codex-managed-hooks.mjs +555 -544
  9. package/dist/agents/baseagent-availability.js +4 -4
  10. package/dist/agents/baseagent.js +29 -1
  11. package/dist/agents/claude-runner.js +152 -14
  12. package/dist/agents/codex/app-server-client.js +18 -8
  13. package/dist/agents/codex/catalog.js +1 -1
  14. package/dist/agents/codex/diagnostics.js +215 -0
  15. package/dist/agents/codex-runner.js +445 -63
  16. package/dist/agents/ecagent-runner.js +31 -16
  17. package/dist/agents/gemini-runner.js +82 -4
  18. package/dist/agents/runner-types.js +1 -1
  19. package/dist/aun/aid/agentmd.js +56 -4
  20. package/dist/aun/aid/index.js +1 -0
  21. package/dist/aun/aid/managed-operation.js +80 -6
  22. package/dist/aun/aid/store.js +41 -0
  23. package/dist/aun/msg/managed-operation.js +6 -1
  24. package/dist/aun/outbox.js +56 -18
  25. package/dist/aun/rpc/client.js +4 -5
  26. package/dist/aun/storage/client.js +4 -1
  27. package/dist/aun/storage/index.js +1 -1
  28. package/dist/channels/aun.js +147 -76
  29. package/dist/channels/daemon.js +7 -1
  30. package/dist/channels/dingtalk.js +1 -0
  31. package/dist/channels/feishu.js +10 -4
  32. package/dist/channels/wecom.js +2 -1
  33. package/dist/cli/agent-command.js +214 -89
  34. package/dist/cli/agent-create.js +576 -0
  35. package/dist/cli/agent.js +129 -676
  36. package/dist/cli/aun-commands.js +419 -313
  37. package/dist/cli/bench.js +20 -20
  38. package/dist/cli/config.js +20 -20
  39. package/dist/cli/contact.js +10 -10
  40. package/dist/cli/ctl-command.js +22 -20
  41. package/dist/cli/daemon-commands.js +163 -32
  42. package/dist/cli/fs-command.js +67 -67
  43. package/dist/cli/handoff-command.js +7 -7
  44. package/dist/cli/index.js +79 -79
  45. package/dist/cli/link-rules.js +21 -21
  46. package/dist/cli/managed-command-guard.js +3 -0
  47. package/dist/cli/menu-client.js +11 -11
  48. package/dist/cli/net-check.js +22 -22
  49. package/dist/cli/queue-command.js +29 -29
  50. package/dist/cli/response.js +30 -30
  51. package/dist/cli/restart-monitor.js +462 -38
  52. package/dist/cli/stats.js +161 -51
  53. package/dist/cli/trigger-command.js +56 -56
  54. package/dist/config/builtin-roles.js +3 -0
  55. package/dist/config/config-manager.js +15 -0
  56. package/dist/config/config-operation-service.js +20 -3
  57. package/dist/config/resolved-config-op.js +39 -1
  58. package/dist/core/auth/auth-gateway.js +3 -2
  59. package/dist/core/auth/authorization-audit.js +72 -19
  60. package/dist/core/auth/operation-authorizer.js +125 -7
  61. package/dist/core/auth/operation-catalog.js +26 -2
  62. package/dist/core/auth/remote-access-store.js +3 -2
  63. package/dist/core/baseagent-loader.js +4 -4
  64. package/dist/core/bootstrap-messages.js +39 -18
  65. package/dist/core/bootstrap-service.js +32 -26
  66. package/dist/core/capability/capability-manager.js +8 -4
  67. package/dist/core/capability/providers/codex-capability-provider.js +1 -1
  68. package/dist/core/command/agent-control.js +60 -26
  69. package/dist/core/command/cli-intent-parser.js +18 -0
  70. package/dist/core/command/command-handler.js +173 -36
  71. package/dist/core/command/menu-catalog.js +4 -1
  72. package/dist/core/command/menu-handler.js +315 -75
  73. package/dist/core/command/menu-protocol.js +7 -2
  74. package/dist/core/command/slash-gate.js +1 -3
  75. package/dist/core/command/slash-handler.js +166 -57
  76. package/dist/core/data-migration.js +5 -15
  77. package/dist/core/event-catalog.js +8 -0
  78. package/dist/core/evolagent.js +3 -3
  79. package/dist/core/handoff/runtime.js +3 -1
  80. package/dist/core/handoff/store.js +7 -1
  81. package/dist/core/message/im-renderer.js +13 -6
  82. package/dist/core/message/message-bridge.js +5 -36
  83. package/dist/core/message/message-utils.js +6 -3
  84. package/dist/core/message/response-engine.js +85 -27
  85. package/dist/core/model/catalog-service.js +3 -1
  86. package/dist/core/model/model-catalog.js +10 -0
  87. package/dist/core/model/model-permission.js +4 -1
  88. package/dist/core/permission/approval-gateway.js +169 -33
  89. package/dist/core/permission/tool-policy.js +56 -10
  90. package/dist/core/session/adapters/codex-session-file-adapter.js +71 -3
  91. package/dist/core/session/session-manager.js +49 -13
  92. package/dist/core/session/session-renew.js +1 -0
  93. package/dist/index.js +327 -134
  94. package/dist/ipc.js +68 -21
  95. package/dist/paths.js +23 -1
  96. package/dist/stats/billing.js +18 -4
  97. package/dist/stats/db.js +159 -159
  98. package/dist/stats/eck-vars.js +9 -9
  99. package/dist/stats/query.js +139 -139
  100. package/dist/stats/role-budget.js +6 -6
  101. package/dist/stats/writer.js +51 -51
  102. package/dist/utils/atomic-write.js +26 -2
  103. package/dist/utils/avatar-upload.js +282 -23
  104. package/dist/utils/cross-platform.js +436 -1
  105. package/dist/utils/error-dict.json +160 -160
  106. package/dist/utils/error-utils.js +11 -4
  107. package/dist/utils/macos-autostart.js +22 -22
  108. package/dist/utils/model-prices.jsonl +23 -20
  109. package/dist/utils/npm-ops.js +24 -1
  110. package/dist/utils/welcome.js +22 -22
  111. package/dist/utils/windows-autostart.js +1 -1
  112. package/ecagent/LICENSE +21 -21
  113. package/ecagent/NOTICE +11 -11
  114. package/ecagent/README.md +61 -61
  115. package/ecagent/dist/harness/compaction/branch-summarization.js +30 -30
  116. package/ecagent/dist/harness/compaction/compaction.js +83 -83
  117. package/ecagent/dist/harness/messages.js +7 -7
  118. package/kits/docs/GUIDE.md +20 -20
  119. package/kits/docs/INDEX.md +66 -66
  120. package/kits/docs/aun/CHEATSHEET.md +19 -19
  121. package/kits/docs/aun/SYNC_PROTOCOL.md +15 -15
  122. package/kits/docs/channels/aun.md +56 -56
  123. package/kits/docs/channels/feishu.md +56 -56
  124. package/kits/docs/context-assembly.md +365 -364
  125. package/kits/docs/eck_templates/GUIDE.template.md +22 -22
  126. package/kits/docs/eck_templates/INDEX.template.md +28 -28
  127. package/kits/docs/eck_templates/path-registry.template.md +33 -33
  128. package/kits/docs/eck_templates/runtime.template.md +19 -19
  129. package/kits/docs/evolcore/INDEX.md +71 -69
  130. package/kits/docs/evolcore/agent-create.md +170 -156
  131. package/kits/docs/evolcore/agent.md +83 -73
  132. package/kits/docs/evolcore/aid.md +64 -62
  133. package/kits/docs/evolcore/codex-windows-sandbox.md +146 -0
  134. package/kits/docs/evolcore/config.md +195 -195
  135. package/kits/docs/evolcore/contact.md +68 -68
  136. package/kits/docs/evolcore/ctl.md +46 -46
  137. package/kits/docs/evolcore/event.md +216 -216
  138. package/kits/docs/evolcore/fs-architecture.md +1215 -1215
  139. package/kits/docs/evolcore/fs.md +110 -110
  140. package/kits/docs/evolcore/group-collaboration.md +243 -243
  141. package/kits/docs/evolcore/group-fs.md +17 -17
  142. package/kits/docs/evolcore/group-rules.md +251 -251
  143. package/kits/docs/evolcore/group.md +152 -152
  144. package/kits/docs/evolcore/menu-client.md +34 -34
  145. package/kits/docs/evolcore/model.md +50 -50
  146. package/kits/docs/evolcore/msg.md +165 -165
  147. package/kits/docs/evolcore/response.md +75 -75
  148. package/kits/docs/evolcore/rpc.md +37 -37
  149. package/kits/docs/evolcore/self-summary.md +29 -29
  150. package/kits/docs/evolcore/stats.md +83 -83
  151. package/kits/docs/evolcore/storage.md +50 -50
  152. package/kits/docs/evolcore/trigger.md +575 -575
  153. package/kits/docs/identity/AID_PROFILE_SPEC.md +26 -26
  154. package/kits/docs/identity/PATH_OPS.md +16 -16
  155. package/kits/docs/identity/ROLE_DETAIL.md +25 -25
  156. package/kits/docs/identity/identity-tools.md +26 -26
  157. package/kits/docs/path-registry.md +62 -62
  158. package/kits/docs/prompt-loading-architecture.md +270 -269
  159. package/kits/docs/venues/aun-group.md +45 -45
  160. package/kits/docs/venues/aun-private.md +10 -10
  161. package/kits/docs/venues/client-desktop.md +10 -10
  162. package/kits/docs/venues/client-mobile.md +10 -10
  163. package/kits/docs/venues/feishu-group.md +13 -13
  164. package/kits/docs/venues/feishu-private.md +9 -9
  165. package/kits/docs/venues/group.md +25 -25
  166. package/kits/docs/venues/private.md +10 -10
  167. package/kits/eck_manifest.auxiliary.json +43 -43
  168. package/kits/eck_manifest.json +195 -183
  169. package/kits/eck_message_manifest.json +74 -74
  170. package/kits/migrations/README-role-config-v4.md +32 -32
  171. package/kits/migrations/migrate-contact-book-v2.mjs +748 -748
  172. package/kits/migrations/migrate-role-config-v4.mjs +614 -614
  173. package/kits/migrations/migrate-role-config-v5.mjs +365 -365
  174. package/kits/migrations/rename-config-file.mjs +99 -99
  175. package/kits/rules/01-overview.md +162 -162
  176. package/kits/rules/02-navigation.md +96 -96
  177. package/kits/rules/03-identity.md +39 -37
  178. package/kits/rules/04-relation.md +75 -75
  179. package/kits/rules/05-venue.md +60 -60
  180. package/kits/rules/06-channel.md +63 -63
  181. package/kits/schemas/_meta.json +53 -53
  182. package/kits/schemas/agent-config.schema.1.json +177 -177
  183. package/kits/schemas/agent-config.schema.10.json +395 -395
  184. package/kits/schemas/agent-config.schema.11.json +421 -421
  185. package/kits/schemas/agent-config.schema.12.json +427 -427
  186. package/kits/schemas/agent-config.schema.2.json +239 -239
  187. package/kits/schemas/agent-config.schema.3.json +119 -119
  188. package/kits/schemas/agent-config.schema.4.json +208 -208
  189. package/kits/schemas/agent-config.schema.5.json +326 -326
  190. package/kits/schemas/agent-config.schema.6.json +322 -322
  191. package/kits/schemas/agent-config.schema.7.json +303 -303
  192. package/kits/schemas/agent-config.schema.8.json +304 -304
  193. package/kits/schemas/agent-config.schema.9.json +364 -364
  194. package/kits/schemas/contact-book.schema.1.json +36 -36
  195. package/kits/schemas/contact-book.schema.2.json +43 -43
  196. package/kits/schemas/contact-book.schema.3.json +67 -67
  197. package/kits/schemas/daemon.schema.1.json +91 -91
  198. package/kits/schemas/daemon.schema.2.json +101 -101
  199. package/kits/schemas/daemon.schema.3.json +123 -123
  200. package/kits/schemas/daemon.schema.4.json +136 -136
  201. package/kits/schemas/daemon.schema.5.json +135 -135
  202. package/kits/schemas/daemon.schema.6.json +131 -131
  203. package/kits/schemas/defaults.schema.1.json +81 -81
  204. package/kits/schemas/defaults.schema.2.json +85 -85
  205. package/kits/schemas/defaults.schema.3.json +73 -73
  206. package/kits/schemas/defaults.schema.4.json +107 -107
  207. package/kits/schemas/defaults.schema.5.json +119 -119
  208. package/kits/schemas/menu-exec-schema-commands.md +208 -208
  209. package/kits/schemas/migrations/README.md +30 -30
  210. package/kits/schemas/relation-config.schema.1.json +158 -158
  211. package/kits/schemas/relation-config.schema.2.json +73 -73
  212. package/kits/schemas/relation-config.schema.3.json +50 -50
  213. package/kits/schemas/relation-config.schema.4.json +47 -47
  214. package/kits/schemas/relation-config.schema.5.json +47 -47
  215. package/kits/schemas/relation-config.schema.6.json +46 -46
  216. package/kits/schemas/relation-config.schema.7.json +59 -59
  217. package/kits/schemas/relation-config.schema.8.json +103 -103
  218. package/kits/schemas/role-config.schema.1.json +201 -201
  219. package/kits/schemas/role-registry.schema.1.json +35 -35
  220. package/kits/schemas/single-session.schema.1.json +31 -31
  221. package/kits/schemas/single-session.schema.2.json +57 -57
  222. package/kits/schemas/single-session.schema.3.json +32 -32
  223. package/kits/templates/bootstrap-welcome.md +17 -17
  224. package/kits/templates/message-fragments/handoff-context-to-target.md +9 -9
  225. package/kits/templates/message-fragments/handoff-request-to-target.md +19 -19
  226. package/kits/templates/message-fragments/handoff-response-to-origin.md +9 -9
  227. package/kits/templates/message-fragments/inject-default.md +2 -2
  228. package/kits/templates/message-fragments/item.md +2 -2
  229. package/kits/templates/roles/admin.json +96 -82
  230. package/kits/templates/roles/member.json +97 -96
  231. package/kits/templates/roles/owner.json +9 -9
  232. package/kits/templates/roles/visitor.json +86 -85
  233. package/kits/templates/system-fragments/baseagent.md +14 -14
  234. package/kits/templates/system-fragments/bootstrap.md +38 -29
  235. package/kits/templates/system-fragments/channel.md +64 -64
  236. package/kits/templates/system-fragments/commands.md +28 -28
  237. package/kits/templates/system-fragments/identity.md +13 -13
  238. package/kits/templates/system-fragments/relation.md +19 -19
  239. package/kits/templates/system-fragments/session.md +59 -59
  240. package/kits/templates/system-fragments/venue.md +31 -31
  241. package/package.json +98 -94
  242. package/AGENTS.md +0 -62
  243. package/dist/utils/codex-cli.js +0 -43
  244. package/skills/eclink/SKILL.md +0 -84
  245. package/skills/eclink/agents/openai.yaml +0 -4
@@ -1,201 +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.effort", "label": "Codex Effort", "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
- ],
19
- "type": "object",
20
- "additionalProperties": false,
21
- "required": ["$schema_version", "description", "permissions"],
22
- "properties": {
23
- "$schema_version": { "type": "number", "const": 1, "default": 1, "description": "角色配置 Schema 版本,固定为 1。" },
24
- "description": { "type": "string", "description": "角色的用途、信任级别和授权边界说明。" },
25
- "rank": { "type": "integer", "enum": [100, 300, 500, 700, 900], "description": "角色排序系数;内置角色固定,自定义角色固定为 500。旧文件缺省时由角色加载器补齐。" },
26
- "allowAccess": { "type": "boolean", "default": true, "description": "是否允许该角色访问 Agent;缺省为 true。" },
27
- "permissions": {
28
- "type": "object",
29
- "required": ["permissionMode"],
30
- "description": "角色对运行时行为字段施加的默认值、关系级覆盖权及候选值约束。",
31
- "properties": {
32
- "permissionMode": {
33
- "type": "object",
34
- "required": ["default", "allowOverride"],
35
- "additionalProperties": false,
36
- "description": "工具调用审批模式策略;该策略必须存在且不允许关系级覆盖。",
37
- "properties": {
38
- "default": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "该角色实际使用的工具调用审批模式。", "x-enumDescriptions": { "readonly": "只读模式:明确只读工具和普通路径上的受限只读 Shell 自动执行;写入、H/L 类读取、未知 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权", "auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝", "request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批", "bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批" } },
39
- "allowOverride": { "const": false, "default": false, "description": "权限模式禁止关系级覆盖,固定为 false。" },
40
- "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "一个可列入权限模式候选集合的值。", "x-enumDescriptions": { "readonly": "只读模式", "auto": "自动模式", "request": "请求人工审批模式", "bypass": "受强制危险规则约束的放行模式" } }, "uniqueItems": true, "description": "保留的权限模式候选集合;permissionMode 当前不可由关系级覆盖,通常无需配置。" },
41
- "reason": { "type": "string", "description": "采用该权限模式策略的可审计原因或管理备注。" }
42
- }
43
- },
44
- "chatmode.private": {
45
- "type": "object",
46
- "required": ["default", "allowOverride"],
47
- "additionalProperties": false,
48
- "description": "该角色在私聊场景中的响应方式策略。",
49
- "properties": {
50
- "default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的私聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
51
- "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖私聊响应方式;缺省为 false。" },
52
- "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive"], "description": "一个可用于私聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "uniqueItems": true, "description": "允许关系级覆盖到的私聊响应方式白名单;若提供,必须包含 default。" },
53
- "reason": { "type": "string", "description": "采用该私聊响应策略的可审计原因或管理备注。" }
54
- }
55
- },
56
- "chatmode.group": {
57
- "type": "object",
58
- "required": ["default", "allowOverride"],
59
- "additionalProperties": false,
60
- "description": "该角色在群聊场景中的响应方式策略。",
61
- "properties": {
62
- "default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的群聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
63
- "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊响应方式;缺省为 false。" },
64
- "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive"], "description": "一个可用于群聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊响应方式白名单;若提供,必须包含 default。" },
65
- "reason": { "type": "string", "description": "采用该群聊响应策略的可审计原因或管理备注。" }
66
- }
67
- },
68
- "mentionMode": {
69
- "type": "object",
70
- "required": ["default", "allowOverride"],
71
- "additionalProperties": false,
72
- "description": "该角色在群聊场景中的提及响应策略。",
73
- "properties": {
74
- "default": { "type": "string", "enum": ["disabled", "mention-only"], "description": "未设置有效关系级覆盖时使用的群聊提及响应策略。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应" } },
75
- "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊提及响应策略;缺省为 false。" },
76
- "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["disabled", "mention-only"], "description": "一个可用于群聊提及响应策略覆盖的值。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊提及响应策略白名单;若提供,必须包含 default。" },
77
- "reason": { "type": "string", "description": "采用该群聊提及响应策略的可审计原因或管理备注。" }
78
- }
79
- },
80
- "baseagents.claude.effort": {
81
- "type": "object",
82
- "required": ["default", "allowOverride"],
83
- "additionalProperties": false,
84
- "description": "该角色使用 Claude runner 时的推理强度策略。",
85
- "properties": {
86
- "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 Claude 推理强度。", "x-enumDescriptions": { "auto": "由 Claude runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
87
- "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Claude 推理强度;缺省为 false。" },
88
- "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。" },
89
- "reason": { "type": "string", "description": "采用该 Claude 推理强度策略的可审计原因或管理备注。" }
90
- }
91
- },
92
- "baseagents.codex.effort": {
93
- "type": "object",
94
- "required": ["default", "allowOverride"],
95
- "additionalProperties": false,
96
- "description": "该角色使用 Codex runner 时的推理强度策略。",
97
- "properties": {
98
- "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh"], "description": "角色默认的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高" } },
99
- "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Codex 推理强度;缺省为 false。" },
100
- "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。" },
101
- "reason": { "type": "string", "description": "采用该 Codex 推理强度策略的可审计原因或管理备注。" }
102
- }
103
- }
104
- },
105
- "patternProperties": {
106
- "^baseagents\\.[a-z0-9_-]+\\.model$": {
107
- "type": "object",
108
- "required": ["default", "allowOverride", "allowedModels"],
109
- "additionalProperties": false,
110
- "description": "指定 base agent 的角色模型策略;默认模型必须匹配 allowedModels。",
111
- "properties": {
112
- "default": { "type": "string", "minLength": 1, "description": "该角色默认使用的模型标识;必须被 allowedModels 中的精确值或通配符允许。" },
113
- "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖模型;缺省为 false。" },
114
- "allowedModels": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "description": "一个允许使用的模型标识或以 * 表达的通配符模式。" }, "uniqueItems": true, "description": "该角色可用的模型白名单;支持通配符,且至少包含一个条目。" },
115
- "reason": { "type": "string", "description": "采用该角色模型策略的可审计原因或管理备注。" }
116
- }
117
- }
118
- },
119
- "additionalProperties": false
120
- },
121
- "commandPermissions": {
122
- "type": "object",
123
- "x-optionsSource": "operation-catalog",
124
- "description": "按 operation 标识定义角色的命令执行权限;候选 operation 来自运行时 operation catalog。",
125
- "propertyNames": { "type": "string", "minLength": 1, "description": "非空 operation 标识,支持精确名称及系统识别的通配规则。" },
126
- "additionalProperties": {
127
- "type": "object",
128
- "required": ["allow"],
129
- "additionalProperties": false,
130
- "description": "一个 operation 的角色授权规则。",
131
- "properties": {
132
- "allow": { "type": "boolean", "description": "是否允许该角色执行匹配的 operation。" },
133
- "dangerous": { "type": "boolean", "default": false, "description": "是否将该授权规则标记为危险操作规则;危险操作还会应用额外安全约束。" },
134
- "permissionMode": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "临时 operation 级权限模式;后续迁移到作用域模式规则。" },
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
- }
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.effort", "label": "Codex Effort", "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
+ ],
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["$schema_version", "description", "permissions"],
22
+ "properties": {
23
+ "$schema_version": { "type": "number", "const": 1, "default": 1, "description": "角色配置 Schema 版本,固定为 1。" },
24
+ "description": { "type": "string", "description": "角色的用途、信任级别和授权边界说明。" },
25
+ "rank": { "type": "integer", "enum": [100, 300, 500, 700, 900], "description": "角色排序系数;内置角色固定,自定义角色固定为 500。旧文件缺省时由角色加载器补齐。" },
26
+ "allowAccess": { "type": "boolean", "default": true, "description": "是否允许该角色访问 Agent;缺省为 true。" },
27
+ "permissions": {
28
+ "type": "object",
29
+ "required": ["permissionMode"],
30
+ "description": "角色对运行时行为字段施加的默认值、关系级覆盖权及候选值约束。",
31
+ "properties": {
32
+ "permissionMode": {
33
+ "type": "object",
34
+ "required": ["default", "allowOverride"],
35
+ "additionalProperties": false,
36
+ "description": "工具调用审批模式策略;该策略必须存在且不允许关系级覆盖。",
37
+ "properties": {
38
+ "default": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "该角色实际使用的工具调用审批模式。", "x-enumDescriptions": { "readonly": "只读模式:明确只读工具和普通路径上的受限只读 Shell 自动执行;写入、H/L 类读取、未知 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权", "auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝", "request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批", "bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批" } },
39
+ "allowOverride": { "const": false, "default": false, "description": "权限模式禁止关系级覆盖,固定为 false。" },
40
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "一个可列入权限模式候选集合的值。", "x-enumDescriptions": { "readonly": "只读模式", "auto": "自动模式", "request": "请求人工审批模式", "bypass": "受强制危险规则约束的放行模式" } }, "uniqueItems": true, "description": "保留的权限模式候选集合;permissionMode 当前不可由关系级覆盖,通常无需配置。" },
41
+ "reason": { "type": "string", "description": "采用该权限模式策略的可审计原因或管理备注。" }
42
+ }
43
+ },
44
+ "chatmode.private": {
45
+ "type": "object",
46
+ "required": ["default", "allowOverride"],
47
+ "additionalProperties": false,
48
+ "description": "该角色在私聊场景中的响应方式策略。",
49
+ "properties": {
50
+ "default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的私聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
51
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖私聊响应方式;缺省为 false。" },
52
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive"], "description": "一个可用于私聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "uniqueItems": true, "description": "允许关系级覆盖到的私聊响应方式白名单;若提供,必须包含 default。" },
53
+ "reason": { "type": "string", "description": "采用该私聊响应策略的可审计原因或管理备注。" }
54
+ }
55
+ },
56
+ "chatmode.group": {
57
+ "type": "object",
58
+ "required": ["default", "allowOverride"],
59
+ "additionalProperties": false,
60
+ "description": "该角色在群聊场景中的响应方式策略。",
61
+ "properties": {
62
+ "default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的群聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
63
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊响应方式;缺省为 false。" },
64
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive"], "description": "一个可用于群聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊响应方式白名单;若提供,必须包含 default。" },
65
+ "reason": { "type": "string", "description": "采用该群聊响应策略的可审计原因或管理备注。" }
66
+ }
67
+ },
68
+ "mentionMode": {
69
+ "type": "object",
70
+ "required": ["default", "allowOverride"],
71
+ "additionalProperties": false,
72
+ "description": "该角色在群聊场景中的提及响应策略。",
73
+ "properties": {
74
+ "default": { "type": "string", "enum": ["disabled", "mention-only"], "description": "未设置有效关系级覆盖时使用的群聊提及响应策略。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应" } },
75
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊提及响应策略;缺省为 false。" },
76
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["disabled", "mention-only"], "description": "一个可用于群聊提及响应策略覆盖的值。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊提及响应策略白名单;若提供,必须包含 default。" },
77
+ "reason": { "type": "string", "description": "采用该群聊提及响应策略的可审计原因或管理备注。" }
78
+ }
79
+ },
80
+ "baseagents.claude.effort": {
81
+ "type": "object",
82
+ "required": ["default", "allowOverride"],
83
+ "additionalProperties": false,
84
+ "description": "该角色使用 Claude runner 时的推理强度策略。",
85
+ "properties": {
86
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 Claude 推理强度。", "x-enumDescriptions": { "auto": "由 Claude runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
87
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Claude 推理强度;缺省为 false。" },
88
+ "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。" },
89
+ "reason": { "type": "string", "description": "采用该 Claude 推理强度策略的可审计原因或管理备注。" }
90
+ }
91
+ },
92
+ "baseagents.codex.effort": {
93
+ "type": "object",
94
+ "required": ["default", "allowOverride"],
95
+ "additionalProperties": false,
96
+ "description": "该角色使用 Codex runner 时的推理强度策略。",
97
+ "properties": {
98
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh"], "description": "角色默认的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高" } },
99
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Codex 推理强度;缺省为 false。" },
100
+ "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。" },
101
+ "reason": { "type": "string", "description": "采用该 Codex 推理强度策略的可审计原因或管理备注。" }
102
+ }
103
+ }
104
+ },
105
+ "patternProperties": {
106
+ "^baseagents\\.[a-z0-9_-]+\\.model$": {
107
+ "type": "object",
108
+ "required": ["default", "allowOverride", "allowedModels"],
109
+ "additionalProperties": false,
110
+ "description": "指定 base agent 的角色模型策略;默认模型必须匹配 allowedModels。",
111
+ "properties": {
112
+ "default": { "type": "string", "minLength": 1, "description": "该角色默认使用的模型标识;必须被 allowedModels 中的精确值或通配符允许。" },
113
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖模型;缺省为 false。" },
114
+ "allowedModels": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "description": "一个允许使用的模型标识或以 * 表达的通配符模式。" }, "uniqueItems": true, "description": "该角色可用的模型白名单;支持通配符,且至少包含一个条目。" },
115
+ "reason": { "type": "string", "description": "采用该角色模型策略的可审计原因或管理备注。" }
116
+ }
117
+ }
118
+ },
119
+ "additionalProperties": false
120
+ },
121
+ "commandPermissions": {
122
+ "type": "object",
123
+ "x-optionsSource": "operation-catalog",
124
+ "description": "按 operation 标识定义角色的命令执行权限;候选 operation 来自运行时 operation catalog。",
125
+ "propertyNames": { "type": "string", "minLength": 1, "description": "非空 operation 标识,支持精确名称及系统识别的通配规则。" },
126
+ "additionalProperties": {
127
+ "type": "object",
128
+ "required": ["allow"],
129
+ "additionalProperties": false,
130
+ "description": "一个 operation 的角色授权规则。",
131
+ "properties": {
132
+ "allow": { "type": "boolean", "description": "是否允许该角色执行匹配的 operation。" },
133
+ "dangerous": { "type": "boolean", "default": false, "description": "是否将该授权规则标记为危险操作规则;危险操作还会应用额外安全约束。" },
134
+ "permissionMode": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "临时 operation 级权限模式;后续迁移到作用域模式规则。" },
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
+ }
@@ -1,35 +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
- }
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
+ }
@@ -1,31 +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 生效):首个可被 PreToolUse 覆盖的本地工具必须是当前会话精确对应的 ec msg/group send,否则拦截;WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不进入此硬拒绝边界。",
15
- "x-enumDescriptions": {
16
- "true": "启用:首个 hook 可覆盖的本地工具必须是精确会话 send",
17
- "false": "禁用:不执行 proactive 首个本地工具 send 检查"
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
- }
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 生效):首个可被 PreToolUse 覆盖的本地工具必须是当前会话精确对应的 ec msg/group send,否则拦截;WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不进入此硬拒绝边界。",
15
+ "x-enumDescriptions": {
16
+ "true": "启用:首个 hook 可覆盖的本地工具必须是精确会话 send",
17
+ "false": "禁用:不执行 proactive 首个本地工具 send 检查"
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
+ }