evolcore 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +45 -10
  3. package/bin/ec-safe-output.js +89 -24
  4. package/dist/agents/baseagent.js +46 -0
  5. package/dist/agents/claude-runner.js +1 -31
  6. package/dist/agents/codex-app-server-client.js +68 -0
  7. package/dist/agents/codex-runner.js +157 -5
  8. package/dist/agents/runner-types.js +2 -2
  9. package/dist/aun/aid/agentmd.js +79 -0
  10. package/dist/aun/aid/encryption-seed-policy.js +29 -0
  11. package/dist/aun/aid/index.js +1 -1
  12. package/dist/aun/aid/store.js +2 -5
  13. package/dist/channels/aun.js +220 -112
  14. package/dist/channels/daemon.js +18 -4
  15. package/dist/channels/dingtalk.js +52 -137
  16. package/dist/channels/feishu.js +56 -4
  17. package/dist/channels/qqbot.js +23 -1
  18. package/dist/channels/wechat.js +303 -155
  19. package/dist/channels/wecom.js +383 -7
  20. package/dist/cli/aun-commands.js +11 -11
  21. package/dist/cli/handoff-command.js +2 -1
  22. package/dist/cli/init-channel.js +185 -67
  23. package/dist/cli/init.js +7 -5
  24. package/dist/cli/trigger-command.js +92 -11
  25. package/dist/config/access-policy-domain.js +38 -0
  26. package/dist/config/access-policy.js +134 -0
  27. package/dist/config/builtin-role-templates.js +27 -14
  28. package/dist/config/builtin-roles.js +25 -6
  29. package/dist/config/config-field-policy.js +17 -5
  30. package/dist/config/config-manager.js +198 -22
  31. package/dist/config/config-operation-service.js +35 -38
  32. package/dist/config/contact-bind-code.js +274 -0
  33. package/dist/config/contact-book-store.js +173 -5
  34. package/dist/config/contact-book.js +32 -0
  35. package/dist/config/contact-operation-service.js +9 -3
  36. package/dist/config/contact-request-service.js +331 -0
  37. package/dist/config/peer-role-resolver.js +3 -1
  38. package/dist/config/schema-registry.js +49 -24
  39. package/dist/config-store.js +14 -2
  40. package/dist/core/auth/agent-delegation.js +105 -11
  41. package/dist/core/auth/authorization-audit.js +6 -0
  42. package/dist/core/auth/operation-authorizer.js +8 -0
  43. package/dist/core/auth/operation-catalog.js +51 -3
  44. package/dist/core/auth/trigger-authorization.js +15 -0
  45. package/dist/core/bootstrap-service.js +2 -9
  46. package/dist/core/channel-loader.js +6 -2
  47. package/dist/core/command/command-handler.js +10 -13
  48. package/dist/core/command/connect-menu.js +249 -24
  49. package/dist/core/command/evol-menu-version-gate.js +38 -0
  50. package/dist/core/command/group-menu.js +421 -0
  51. package/dist/core/command/menu-handler.js +269 -85
  52. package/dist/core/command/menu-protocol.js +8 -2
  53. package/dist/core/command/menu-token-store.js +102 -0
  54. package/dist/core/command/slash-gate.js +1 -1
  55. package/dist/core/command/slash-handler.js +158 -31
  56. package/dist/core/daemon-file-cache.js +28 -0
  57. package/dist/core/event-catalog.js +29 -0
  58. package/dist/core/evolagent-registry.js +4 -39
  59. package/dist/core/handoff/runtime.js +162 -37
  60. package/dist/core/handoff/store.js +46 -2
  61. package/dist/core/handoff/types.js +1 -0
  62. package/dist/core/inference/text-inference.js +16 -74
  63. package/dist/core/message/file-markers.js +7 -0
  64. package/dist/core/message/im-renderer.js +18 -14
  65. package/dist/core/message/inbound-admission.js +124 -0
  66. package/dist/core/message/message-bridge.js +616 -74
  67. package/dist/core/message/message-log.js +1 -0
  68. package/dist/core/message/message-queue.js +185 -10
  69. package/dist/core/message/peer-mode.js +7 -8
  70. package/dist/core/message/response-engine.js +381 -79
  71. package/dist/core/permission/approval-gateway.js +17 -10
  72. package/dist/core/permission/ec-command-parser.js +101 -46
  73. package/dist/core/permission/tool-policy.js +69 -24
  74. package/dist/core/protected-paths.js +36 -11
  75. package/dist/core/session/session-manager.js +25 -3
  76. package/dist/core/session/session-mapper.js +2 -0
  77. package/dist/core/session/session-renew.js +125 -69
  78. package/dist/core/session/session-turn-coordinator.js +5 -1
  79. package/dist/eck/kit-renderer.js +12 -1
  80. package/dist/eck/message-renderer.js +79 -1
  81. package/dist/index.js +224 -89
  82. package/dist/ipc.js +81 -4
  83. package/dist/paths.js +3 -0
  84. package/dist/response-system/config-resolver.js +29 -0
  85. package/dist/response-system/coordinator.js +8 -32
  86. package/dist/response-system/engines/v1/proactive-flow.js +1 -1
  87. package/dist/response-system/index.js +1 -0
  88. package/dist/response-system/modes/single-session/index.js +7 -4
  89. package/dist/trigger/parser.js +55 -15
  90. package/dist/trigger/patch.js +4 -1
  91. package/dist/trigger/scheduler.js +441 -39
  92. package/dist/utils/error-dict.json +7 -0
  93. package/dist/utils/evolcore-version.js +21 -0
  94. package/dist/utils/logger.js +2 -2
  95. package/dist/utils/stable-semver.js +21 -0
  96. package/dist/utils/stats.js +33 -9
  97. package/kits/docs/channels/aun.md +4 -13
  98. package/kits/docs/evolcore/INDEX.md +1 -1
  99. package/kits/docs/evolcore/config.md +47 -2
  100. package/kits/docs/evolcore/contact.md +7 -3
  101. package/kits/docs/evolcore/group-rules.md +46 -4
  102. package/kits/docs/evolcore/group.md +4 -4
  103. package/kits/docs/evolcore/msg.md +5 -5
  104. package/kits/docs/evolcore/trigger.md +25 -8
  105. package/kits/docs/path-registry.md +36 -17
  106. package/kits/eck_message_manifest.json +12 -1
  107. package/kits/migrations/migrate-contact-book-v2.mjs +7 -0
  108. package/kits/rules/01-overview.md +17 -7
  109. package/kits/rules/02-navigation.md +38 -18
  110. package/kits/rules/03-identity.md +28 -24
  111. package/kits/rules/04-relation.md +44 -28
  112. package/kits/rules/05-venue.md +31 -15
  113. package/kits/rules/06-channel.md +11 -7
  114. package/kits/schemas/_meta.json +18 -7
  115. package/kits/schemas/agent-config.schema.7.json +303 -0
  116. package/kits/schemas/agent-config.schema.8.json +304 -0
  117. package/kits/schemas/agent-config.schema.9.json +374 -0
  118. package/kits/schemas/contact-book.schema.3.json +67 -0
  119. package/kits/schemas/daemon.schema.1.json +3 -2
  120. package/kits/schemas/daemon.schema.2.json +101 -0
  121. package/kits/schemas/daemon.schema.3.json +123 -0
  122. package/kits/schemas/defaults.schema.2.json +85 -0
  123. package/kits/schemas/defaults.schema.3.json +73 -0
  124. package/kits/schemas/relation-config.schema.6.json +46 -0
  125. package/kits/schemas/relation-config.schema.7.json +59 -0
  126. package/kits/schemas/single-session.schema.2.json +57 -0
  127. package/kits/templates/message-fragments/handoff-context-to-target.md +9 -0
  128. package/kits/templates/message-fragments/handoff-request-to-target.md +14 -8
  129. package/kits/templates/message-fragments/handoff-response-to-origin.md +5 -6
  130. package/kits/templates/roles/admin.json +46 -0
  131. package/kits/templates/roles/member.json +4 -0
  132. package/kits/templates/roles/visitor.json +4 -0
  133. package/kits/templates/system-fragments/channel.md +12 -2
  134. package/kits/templates/system-fragments/identity.md +3 -1
  135. package/kits/templates/system-fragments/relation.md +1 -1
  136. package/kits/templates/system-fragments/session.md +6 -2
  137. package/package.json +4 -2
  138. package/MIGRATION-0.5.0.md +0 -378
  139. package/ROLE_ACCESS_CONTROL.md +0 -174
  140. package/dist/channels/contact-bind-code.js +0 -134
  141. package/dist/channels/wecom-card.js +0 -101
  142. package/dist/channels/wecom-onboarding.js +0 -82
  143. package/dist/channels/wecom-state.js +0 -191
@@ -0,0 +1,123 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "daemon.schema.3.json",
4
+ "title": "ProcessConfig v3 (daemon.json)",
5
+ "description": "进程级配置:daemon 自身运行配置,链外独立作用域,不进覆盖链。",
6
+ "x-logical-name": "daemon",
7
+ "x-scope": "process",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "$schema_version": { "type": "number", "const": 3, "default": 3, "x-merge": "scalar" },
12
+ "aid": { "type": "string", "description": "daemon 默认身份 AID", "x-merge": "scalar" },
13
+ "owners": {
14
+ "type": "array",
15
+ "items": { "type": "string" },
16
+ "description": "进程控制面鉴权名单(谁能远程管 daemon)",
17
+ "x-merge": "list"
18
+ },
19
+ "debug": {
20
+ "type": "object",
21
+ "description": "进程级调试配置;唯一合法来源为 daemon.json,不参与 Agent 覆盖链",
22
+ "x-merge": "dict",
23
+ "additionalProperties": false,
24
+ "properties": {
25
+ "logLevel": {
26
+ "type": "string",
27
+ "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
28
+ "description": "daemon 日志级别"
29
+ },
30
+ "flusherDiag": {
31
+ "type": "boolean",
32
+ "description": "是否启用消息 flusher 诊断"
33
+ },
34
+ "aunTrace": {
35
+ "type": "boolean",
36
+ "description": "是否记录 AUN 协议 trace"
37
+ },
38
+ "aunSdkLog": {
39
+ "type": "boolean",
40
+ "description": "是否启用 AUN SDK 调试日志"
41
+ },
42
+ "upmsg": {
43
+ "type": "boolean",
44
+ "description": "是否向 Agent owner 发送 daemon 上线通知"
45
+ },
46
+ "eckSnapshots": {
47
+ "type": "boolean",
48
+ "default": false,
49
+ "description": "是否写入可能包含敏感上下文的 ECK 旁路调试快照"
50
+ }
51
+ }
52
+ },
53
+ "tunnel": {
54
+ "type": "object",
55
+ "description": "内网穿透配置",
56
+ "x-merge": "dict",
57
+ "properties": {
58
+ "targets": { "type": "array", "description": "穿透目标列表", "items": { "type": "object" } }
59
+ }
60
+ },
61
+ "aun": {
62
+ "type": "object",
63
+ "description": "AUN 进程配置",
64
+ "x-merge": "dict",
65
+ "properties": {
66
+ "encryptionSeed": { "type": ["string", "null"], "description": "已废弃兼容字段;EvolCore 固定使用内置值,检测到其他值时拒绝启动并提示联系管理人员" },
67
+ "minEvolVersion": {
68
+ "type": "string",
69
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$",
70
+ "description": "AUN Menu 允许的最低 Evol 客户端版本;省略时不限制"
71
+ },
72
+ "menuTokenRequired": {
73
+ "type": "boolean",
74
+ "default": false,
75
+ "description": "是否要求普通 AUN Menu 请求携带有效 menu_token;默认 false"
76
+ }
77
+ }
78
+ },
79
+ "serviceProxy": {
80
+ "type": "object",
81
+ "description": "AUN Service Proxy:把一个本地 HTTP/WS 服务暴露到 AUN 网络",
82
+ "x-merge": "dict",
83
+ "properties": {
84
+ "enabled": { "type": "boolean", "description": "是否启用 Service Proxy" },
85
+ "services": { "type": "array", "description": "暴露到 AUN 的本地服务列表", "items": { "type": "object" } }
86
+ }
87
+ },
88
+ "configSnapshots": {
89
+ "type": "boolean",
90
+ "default": true,
91
+ "description": "是否自动维护配置快照、启动日志和自检回落",
92
+ "x-merge": "scalar"
93
+ },
94
+ "idleMonitor": {
95
+ "type": "object",
96
+ "description": "流式输出空闲监控配置",
97
+ "x-merge": "dict",
98
+ "properties": {
99
+ "enabled": { "type": "boolean", "default": true, "description": "是否启用空闲监控" },
100
+ "timeout": { "type": "number", "default": 120, "description": "空闲超时秒数" },
101
+ "retryAttemptTimeout": { "type": "number", "description": "API 重试尝试连续无事件时的超时秒数;未设置时继承 timeout" },
102
+ "maxExecutionTime": { "type": "number", "default": 3600, "description": "单个任务总执行时限(秒),等待审批期间仍继续计时" }
103
+ }
104
+ },
105
+ "ecweb": {
106
+ "type": "object",
107
+ "description": "web 控制台开关/端口",
108
+ "x-merge": "dict",
109
+ "properties": {
110
+ "enabled": { "type": "boolean", "description": "是否启用 web 控制台" },
111
+ "port": { "type": "number", "description": "web 控制台监听端口" }
112
+ }
113
+ },
114
+ "watch": {
115
+ "type": "object",
116
+ "description": "日志监听配置",
117
+ "x-merge": "dict",
118
+ "properties": {
119
+ "logTypes": { "type": "array", "description": "要监听的日志类型", "items": { "type": "string" } }
120
+ }
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "defaults.schema.2.json",
4
+ "title": "DefaultsConfig v2 (agents/defaults.json)",
5
+ "description": "全局默认配置。覆盖链最低层。",
6
+ "x-logical-name": "defaults",
7
+ "x-scope": "defaults",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "$schema_version": { "type": "number", "const": 2, "default": 2, "x-merge": "scalar" },
12
+ "models": {
13
+ "type": "object",
14
+ "description": "模型配置",
15
+ "x-merge": "dict",
16
+ "properties": {
17
+ "default": { "type": "string", "description": "全局默认模型" },
18
+ "allowed": {
19
+ "type": "array",
20
+ "items": { "type": "string" },
21
+ "description": "全局模型白名单"
22
+ }
23
+ }
24
+ },
25
+ "active_baseagent": {
26
+ "type": "string",
27
+ "description": "当前活跃的 base agent(claude/codex/gemini)。暂存于此,待权限体系实现后迁移。",
28
+ "x-merge": "scalar"
29
+ },
30
+ "baseagents": {
31
+ "type": "object",
32
+ "description": "各 base agent 配置(model/effort/apiKey/baseUrl 等)。暂存于此,待权限体系实现后迁移。",
33
+ "x-merge": "dict"
34
+ },
35
+ "projects": {
36
+ "type": "object",
37
+ "description": "项目路径配置",
38
+ "x-merge": "dict",
39
+ "properties": {
40
+ "rootPath": { "type": "string", "description": "全局项目根路径" },
41
+ "defaultPath": { "type": "string", "description": "全局默认项目路径" }
42
+ }
43
+ },
44
+ "aun": {
45
+ "type": "object",
46
+ "description": "全局 AUN 配置",
47
+ "x-merge": "dict",
48
+ "properties": {
49
+ "keystorePath": { "type": "string" },
50
+ "encryptionSeed": { "type": "string" },
51
+ "gatewayUrl": { "type": "string" }
52
+ }
53
+ },
54
+ "debug": {
55
+ "type": "object",
56
+ "description": "全局调试配置",
57
+ "x-merge": "dict",
58
+ "properties": {
59
+ "logLevel": { "type": "string", "enum": ["DEBUG", "INFO", "WARN", "ERROR"], "description": "日志级别", "x-enumDescriptions": { "DEBUG": "调试:最详细", "INFO": "信息:常规运行日志", "WARN": "警告:仅警告及以上", "ERROR": "错误:仅错误" } },
60
+ "flusherDiag": { "type": "boolean" },
61
+ "aunTrace": { "type": "boolean" },
62
+ "aunSdkLog": { "type": "boolean" },
63
+ "upmsg": { "type": "boolean" }
64
+ }
65
+ },
66
+ "responseMode": { "type": "string", "x-merge": "scalar" },
67
+ "responseModeParams": {
68
+ "type": "object",
69
+ "x-merge": "dict",
70
+ "description": "响应模式特有参数的全局默认字典,按模式 id 分桶:{ [modeId]: {...} }"
71
+ },
72
+ "config": { "type": "object", "x-merge": "dict" },
73
+ "session_renew": {
74
+ "type": "object",
75
+ "description": "会话超时后的续接判定策略,默认关闭",
76
+ "x-merge": "dict",
77
+ "additionalProperties": false,
78
+ "properties": {
79
+ "enabled": { "type": "boolean", "default": false, "description": "是否启用超时后的会话连续性判定" },
80
+ "after_hours": { "type": "number", "exclusiveMinimum": 0, "default": 24, "description": "距最后一条有效对话超过该小时数才触发判定" },
81
+ "fallback_action": { "type": "string", "enum": ["continue", "new"], "default": "continue", "description": "无法判定时的兜底动作", "x-enumDescriptions": { "continue": "继续沿用当前会话", "new": "开启新会话" } }
82
+ }
83
+ }
84
+ }
85
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "defaults.schema.3.json",
4
+ "title": "DefaultsConfig v3 (agents/defaults.json)",
5
+ "description": "全局默认配置。覆盖链最低层;进程级 debug 仅允许配置在 daemon.json。",
6
+ "x-logical-name": "defaults",
7
+ "x-scope": "defaults",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "$schema_version": { "type": "number", "const": 3, "default": 3, "x-merge": "scalar" },
12
+ "models": {
13
+ "type": "object",
14
+ "description": "模型配置",
15
+ "x-merge": "dict",
16
+ "properties": {
17
+ "default": { "type": "string", "description": "全局默认模型" },
18
+ "allowed": {
19
+ "type": "array",
20
+ "items": { "type": "string" },
21
+ "description": "全局模型白名单"
22
+ }
23
+ }
24
+ },
25
+ "active_baseagent": {
26
+ "type": "string",
27
+ "description": "当前活跃的 base agent(claude/codex/gemini)。暂存于此,待权限体系实现后迁移。",
28
+ "x-merge": "scalar"
29
+ },
30
+ "baseagents": {
31
+ "type": "object",
32
+ "description": "各 base agent 配置(model/effort/apiKey/baseUrl 等)。暂存于此,待权限体系实现后迁移。",
33
+ "x-merge": "dict"
34
+ },
35
+ "projects": {
36
+ "type": "object",
37
+ "description": "项目路径配置",
38
+ "x-merge": "dict",
39
+ "properties": {
40
+ "rootPath": { "type": "string", "description": "全局项目根路径" },
41
+ "defaultPath": { "type": "string", "description": "全局默认项目路径" }
42
+ }
43
+ },
44
+ "aun": {
45
+ "type": "object",
46
+ "description": "全局 AUN 配置",
47
+ "x-merge": "dict",
48
+ "properties": {
49
+ "keystorePath": { "type": "string" },
50
+ "encryptionSeed": { "type": "string" },
51
+ "gatewayUrl": { "type": "string" }
52
+ }
53
+ },
54
+ "responseMode": { "type": "string", "x-merge": "scalar" },
55
+ "responseModeParams": {
56
+ "type": "object",
57
+ "x-merge": "dict",
58
+ "description": "响应模式特有参数的全局默认字典,按模式 id 分桶:{ [modeId]: {...} }"
59
+ },
60
+ "config": { "type": "object", "x-merge": "dict" },
61
+ "session_renew": {
62
+ "type": "object",
63
+ "description": "会话超时后的续接判定策略,默认关闭",
64
+ "x-merge": "dict",
65
+ "additionalProperties": false,
66
+ "properties": {
67
+ "enabled": { "type": "boolean", "default": false, "description": "是否启用超时后的会话连续性判定" },
68
+ "after_hours": { "type": "number", "exclusiveMinimum": 0, "default": 24, "description": "距最后一条有效对话超过该小时数才触发判定" },
69
+ "fallback_action": { "type": "string", "enum": ["continue", "new"], "default": "continue", "description": "无法判定时的兜底动作", "x-enumDescriptions": { "continue": "继续沿用当前会话", "new": "开启新会话" } }
70
+ }
71
+ }
72
+ }
73
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.6.json",
4
+ "title": "RelationConfig v6 (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": 6, "default": 6, "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
+ "fallback_action": { "type": "string", "enum": ["continue", "new"] }
39
+ }
40
+ },
41
+ "group_venue_sync": { "type": "object", "x-merge": "dict" },
42
+ "render": { "type": "object", "x-merge": "dict" },
43
+ "sessionManifests": { "type": "object", "x-merge": "dict" },
44
+ "extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
45
+ }
46
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.7.json",
4
+ "title": "RelationConfig v7 (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": 7, "default": 7, "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
+ "fallback_action": { "type": "string", "enum": ["continue", "new"] }
39
+ }
40
+ },
41
+ "group_venue_sync": { "type": "object", "x-merge": "dict" },
42
+ "groupRules": {
43
+ "type": "object",
44
+ "x-merge": "dict",
45
+ "additionalProperties": false,
46
+ "properties": {
47
+ "mode": {
48
+ "type": "string",
49
+ "enum": ["load", "ignore"],
50
+ "default": "load",
51
+ "description": "是否读取并注入当前 AUN 群已发布的 /rules.md;默认 load。"
52
+ }
53
+ }
54
+ },
55
+ "render": { "type": "object", "x-merge": "dict" },
56
+ "sessionManifests": { "type": "object", "x-merge": "dict" },
57
+ "extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
58
+ }
59
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "single-session.schema.2.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
+ "auxiliaryModel": {
11
+ "oneOf": [
12
+ {
13
+ "type": "string",
14
+ "minLength": 1
15
+ },
16
+ {
17
+ "type": "object",
18
+ "minProperties": 1,
19
+ "additionalProperties": false,
20
+ "properties": {
21
+ "claude": { "type": "string", "minLength": 1 },
22
+ "codex": { "type": "string", "minLength": 1 }
23
+ }
24
+ }
25
+ ],
26
+ "description": "辅助判断模型;可直接配置模型 ID,或按 claude/codex 配置映射。当前 Session 的 baseagent 在映射中无对应模型时执行 fallback_action。"
27
+ },
28
+ "auxiliaryEffort": {
29
+ "type": "string",
30
+ "enum": ["low", "medium", "high", "xhigh", "max"],
31
+ "description": "辅助判断推理强度;配置时同一模式桶必须同时配置 auxiliaryModel,未配置时不向模型 API 发送 effort。"
32
+ },
33
+ "pre_tool_1stmsgchk": {
34
+ "type": "boolean",
35
+ "enum": [true, false],
36
+ "default": true,
37
+ "description": "proactive 首工具表态检查(仅 chatmode=proactive 生效):首个工具调用前必须先向对端表态,否则拦截。",
38
+ "x-enumDescriptions": {
39
+ "true": "启用:首工具前必须先发送消息或文件",
40
+ "false": "禁用:允许直接调用工具"
41
+ }
42
+ },
43
+ "tool_use_reminder": {
44
+ "type": "boolean",
45
+ "enum": [true, false],
46
+ "default": true,
47
+ "description": "proactive 工具汇报提醒(仅 chatmode=proactive 生效):启用队列未读提醒 + 每 10 次工具调用的汇报提醒。",
48
+ "x-enumDescriptions": {
49
+ "true": "启用:自动汇报工具使用情况",
50
+ "false": "禁用:静默执行工具"
51
+ }
52
+ }
53
+ },
54
+ "dependencies": {
55
+ "auxiliaryEffort": ["auxiliaryModel"]
56
+ }
57
+ }
@@ -0,0 +1,9 @@
1
+ 说明:
2
+ - 以下是此前未纳入本会话上下文的本地发言,仅补充一次。
3
+ - 请结合这些发言与当前对端回复继续处理。
4
+
5
+ 本地发言:
6
+ {{#each handoffContextEntries}}- {{previousContent}}
7
+ {{/each}}
8
+ 当前对端回复内容:
9
+ {{content}}
@@ -1,13 +1,19 @@
1
1
  说明:
2
- - 跨会话请求回复,仅本端可见。
3
- - 请结合下方内容理解当前对端回复。
4
- - 当前回流策略:{{handoffReturnPolicy}}
5
- - 若策略为 required 且当前回复足以处理请求,使用:`ec handoff return {{handoffId}} "<完整回流内容>"`
6
- - 若策略为 none 且当前回复已处理请求,使用:`ec handoff return {{handoffId}}`
2
+ - 以下是尚未完成的跨会话请求,仅本端可见。
3
+ - 请结合请求列表与当前对端回复,分别判断哪些请求已经得到充分回答。
4
+ - 不要在对外回复中主动提及 handoff、ID、return 命令或内部路由机制。
5
+ - 当前回复足以处理某项请求时,需要使用:`ec handoff return ID "<完整回流内容>"`
6
+ - 命令双引号内若含双引号、反引号或 Shell 展开形式的 `$`,需经转义符转义,Shell 传给 ec 时会做还原。
7
7
  - 若回复不足,不要执行 return。
8
8
 
9
- 此前发给当前对端的内容:
10
- {{handoffPreviousContent}}
11
-
9
+ 待回流请求:
10
+ {{#each handoffRequiredEntries}}- ID:{{handoffId}}
11
+ 原请求:{{previousContent}}
12
+ {{/each}}
13
+ {{?handoffContextEntries}}
14
+ 以下本地发言只用于补充上下文,不需要回流:
15
+ {{#each handoffContextEntries}}- {{previousContent}}
16
+ {{/each}}
17
+ {{/}}
12
18
  当前对端回复内容:
13
19
  {{content}}
@@ -1,10 +1,9 @@
1
1
  说明:
2
2
  - 跨会话结果回流,仅本端可见。
3
- - 这是此前本会话请求的返回结果,请结合当前上下文回复当前对端。
3
+ - 以下是此前本会话一个或多个请求的返回结果,请逐项结合当前上下文处理。
4
4
  - 不要提及 handoff 或内部路由机制。
5
5
 
6
- 此前跨会话请求内容:
7
- {{handoffPreviousContent}}
8
-
9
- 回流内容:
10
- {{content}}
6
+ 待处理结果:
7
+ {{#each handoffOriginEntries}}- 原请求:{{previousContent}}
8
+ 返回结果:{{responseContent}}
9
+ {{/each}}
@@ -5,5 +5,51 @@
5
5
  "allowAccess": true,
6
6
  "permissions": {
7
7
  "permissionMode": { "default": "request", "allowOverride": false }
8
+ },
9
+ "commandPermissions": {
10
+ "contact.read": { "allow": true, "scopes": ["agent"] },
11
+ "contact.block": {
12
+ "allow": true,
13
+ "scopes": ["agent"],
14
+ "constraints": { "requireAgentAdmin": true }
15
+ },
16
+ "connect.write": {
17
+ "allow": true,
18
+ "scopes": ["agent"],
19
+ "constraints": { "requireAgentAdmin": true }
20
+ },
21
+ "connect.access.write": {
22
+ "allow": true,
23
+ "scopes": ["agent"],
24
+ "constraints": { "requireAgentOwner": true }
25
+ },
26
+ "role.assign": { "allow": true, "scopes": ["agent"] },
27
+ "role.revoke": { "allow": true, "scopes": ["agent"] },
28
+ "role.policy.read": { "allow": true, "scopes": ["agent"] },
29
+ "role.relation.read": { "allow": true, "scopes": ["agent"] },
30
+ "config.get": { "allow": true, "scopes": ["agent", "relation"] },
31
+ "config.set": { "allow": true, "scopes": ["agent", "relation"] },
32
+ "config.unset": { "allow": true, "scopes": ["agent", "relation"] },
33
+ "role.policy.write": {
34
+ "allow": true,
35
+ "dangerous": true,
36
+ "scopes": ["agent"],
37
+ "constraints": { "requireAgentAdmin": true }
38
+ },
39
+ "*": { "allow": true },
40
+ "agent.reload": {
41
+ "allow": true,
42
+ "dangerous": true,
43
+ "scopes": ["agent"],
44
+ "constraints": {
45
+ "targetCurrentAgentOnly": true,
46
+ "requireAgentAdmin": true
47
+ }
48
+ },
49
+ "dangerous:*": {
50
+ "allow": true,
51
+ "dangerous": true,
52
+ "constraints": { "requireDaemonOwner": true }
53
+ }
8
54
  }
9
55
  }
@@ -29,6 +29,10 @@
29
29
  "chatmode.update": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
30
30
  "mentionmode.current": { "allow": true, "scopes": ["relation"], "constraints": { "groupOnly": true } },
31
31
  "mentionmode.update": { "allow": false },
32
+ "group.mentionmode.current": { "allow": true, "scopes": ["relation"], "constraints": { "groupOnly": true, "currentRelationOnly": true, "targetCurrentAgentOnly": true } },
33
+ "group.mentionmode.update": { "allow": false },
34
+ "group.rulespolicy.current": { "allow": true, "scopes": ["relation"], "constraints": { "groupOnly": true, "currentRelationOnly": true, "targetCurrentAgentOnly": true } },
35
+ "group.rulespolicy.update": { "allow": false },
32
36
  "trigger.*": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
33
37
  "ec.msg.send": { "allow": true, "constraints": { "ownPeerOnly": true } },
34
38
  "ec.msg.file": { "allow": true, "constraints": { "ownPeerOnly": true } },
@@ -27,6 +27,10 @@
27
27
  "chatmode.update": { "allow": false },
28
28
  "mentionmode.current": { "allow": true, "scopes": ["relation"], "constraints": { "groupOnly": true } },
29
29
  "mentionmode.update": { "allow": false },
30
+ "group.mentionmode.current": { "allow": true, "scopes": ["relation"], "constraints": { "groupOnly": true, "currentRelationOnly": true, "targetCurrentAgentOnly": true } },
31
+ "group.mentionmode.update": { "allow": false },
32
+ "group.rulespolicy.current": { "allow": true, "scopes": ["relation"], "constraints": { "groupOnly": true, "currentRelationOnly": true, "targetCurrentAgentOnly": true } },
33
+ "group.rulespolicy.update": { "allow": false },
30
34
  "trigger.*": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "targetCurrentAgentOnly": true } },
31
35
  "session.list": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true } },
32
36
  "ec.msg.send": { "allow": true, "scopes": ["relation"], "constraints": { "ownPeerOnly": true, "privateOnly": true } },
@@ -24,8 +24,13 @@ chatMode: {{chatMode}} # interactive=同步对话 / proactive=主动推送
24
24
  {{/}}
25
25
  {{?groupId}}
26
26
  {{?channel=aun}}
27
- ec group send {{selfAid}} {{groupId}} "<text>" [--encrypt|--no-encrypt] [--file <path> --as image|video|voice|file] [--payload '<json>'] [--mention <aid>] [--mention-all]
27
+ ec group send {{selfAid}} {{groupId}} "<text>" [--return none|required] [--encrypt|--no-encrypt] [--file <path> --as image|video|voice|file] [--payload '<json>'] [--mention <aid>] [--mention-all]
28
+ # 双引号正文中的双引号、反引号和 Shell 变量 `$` 需分别在其前加反斜杠;ec 收到的仍是原字符。
28
29
  group-send 是群内公开回复;interactive 下直接输出即为公开回复,仅 @某人/发文件/手动控制加密时才需此命令
30
+ # 跨会话发送必须显式填写 --return none|required;同会话发送不要求。
31
+ {{?isTriggerTask}}
32
+ # Trigger 任务的跨会话发送只允许 --return none,禁止 required。
33
+ {{/}}
29
34
  # 加密:消息信封头标注每条入站消息是 🔒密文 还是 ✉明文。你用 group send 时【必须】跟随本轮入站消息的加密态——
30
35
  # 回复某条密文消息务必带 --encrypt,回复明文消息带 --no-encrypt;不带任何加密参数则默认明文发送。
31
36
  # interactive 下你直接输出的回复由 evolcore 自动按入站加密态发送(批次含密文则整轮密文),无需你操心。
@@ -36,8 +41,13 @@ group-send 是群内公开回复;interactive 下直接输出即为公开回复
36
41
  {{/}}
37
42
  {{?peerId}}
38
43
  {{?channel=aun}}
39
- ec msg send {{selfAid}} {{peerId}} "<text>" [--text-from-file <path>] [--encrypt|--no-encrypt] [--file <path> --as image|video|voice|file] [--link <url> --title "<title>"] [--payload '<json>']
44
+ ec msg send {{selfAid}} {{peerId}} "<text>" [--return none|required] [--text-from-file <path>] [--encrypt|--no-encrypt] [--file <path> --as image|video|voice|file] [--link <url> --title "<title>"] [--payload '<json>']
45
+ # 双引号正文中的双引号、反引号和 Shell 变量 `$` 需分别在其前加反斜杠;ec 收到的仍是原字符。
40
46
  msg-send 用于私聊对端的附加能力(文件/链接/手动控制加密);群聊中仅在确需私下联系本条消息发送者时才用,否则用上面的 group send
47
+ # 跨会话发送必须显式填写 --return none|required;同会话发送不要求。
48
+ {{?isTriggerTask}}
49
+ # Trigger 任务的跨会话发送只允许 --return none,禁止 required。
50
+ {{/}}
41
51
  # 加密:消息信封头标注每条入站消息是 🔒密文 还是 ✉明文。你用 msg send 时【必须】跟随你所回复的那条入站消息的加密态——
42
52
  # 回复密文消息务必带 --encrypt,回复明文消息带 --no-encrypt;不带任何加密参数则默认明文发送(密文会话漏发明文是严重事故)。
43
53
  # interactive 下你直接输出的回复由 evolcore 自动按入站加密态发送,无需你操心;仅当你显式调用 msg send 时才需自己带加密参数。
@@ -1,6 +1,8 @@
1
1
  [identity]
2
- {{?selfAid}}
2
+ {{?selfName}}
3
3
  selfName: {{selfName}}
4
+ {{/}}
5
+ {{?selfAid}}
4
6
  selfAid: {{selfAid}}
5
7
  {{/}}
6
8
  {{?hasPersona}}
@@ -11,7 +11,7 @@ peerKey: {{peerKey}} # 跨渠道唯一标识,格式 channel#urlEncode(peerId)
11
11
  {{?groupId}}
12
12
  groupId: {{groupId}}
13
13
  {{?groupRulesStatus}}
14
- groupRulesStatus: {{groupRulesStatus}} # synced/cached/missing/forbidden/invalid_metadata/file_mismatch/too_large/unreadable/error
14
+ groupRulesStatus: {{groupRulesStatus}} # ignored/synced/cached/missing/forbidden/invalid_metadata/file_mismatch/too_large/unreadable/error
15
15
  {{/}}
16
16
  {{?groupRulesError}}
17
17
  groupRulesError: {{groupRulesError}}