evolcore 0.0.32 → 0.0.34

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 (214) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/bin/ec.js +3 -2
  3. package/bin/install-codex-managed-hooks.mjs +135 -37
  4. package/dist/agents/baseagent-availability.js +20 -36
  5. package/dist/agents/claude-runner.js +111 -15
  6. package/dist/agents/codex/app-server-client.js +3 -0
  7. package/dist/agents/codex/diagnostics.js +112 -54
  8. package/dist/agents/codex-runner.js +241 -63
  9. package/dist/agents/ecagent-runner.js +78 -33
  10. package/dist/agents/runner-types.js +5 -6
  11. package/dist/aun/aid/identity.js +1 -1
  12. package/dist/aun/group/operations.js +0 -1
  13. package/dist/aun/msg/history.js +1 -0
  14. package/dist/aun/msg/p2p.js +0 -1
  15. package/dist/aun/outbox.js +50 -1
  16. package/dist/channels/aun.js +44 -8
  17. package/dist/channels/daemon.js +261 -3
  18. package/dist/cli/agent-command.js +58 -24
  19. package/dist/cli/agent.js +1 -1
  20. package/dist/cli/aun-commands.js +368 -31
  21. package/dist/cli/contact.js +8 -2
  22. package/dist/cli/ctl-command.js +3 -1
  23. package/dist/cli/daemon-commands.js +197 -27
  24. package/dist/cli/debug-mode.js +154 -0
  25. package/dist/cli/fs-command.js +2 -1
  26. package/dist/cli/handoff-command.js +3 -0
  27. package/dist/cli/index.js +98 -67
  28. package/dist/cli/init.js +2 -2
  29. package/dist/cli/integrity-command.js +196 -0
  30. package/dist/cli/managed-command-guard.js +5 -0
  31. package/dist/cli/memory-command.js +166 -146
  32. package/dist/cli/queue-command.js +9 -4
  33. package/dist/cli/session-command.js +194 -0
  34. package/dist/cli/skill-command.js +78 -2
  35. package/dist/cli/task-context.js +1 -0
  36. package/dist/cli/thread-command.js +622 -0
  37. package/dist/cli/trigger-command.js +10 -3
  38. package/dist/config/builtin-roles.js +1 -0
  39. package/dist/config/config-field-policy.js +6 -3
  40. package/dist/config/config-manager.js +26 -2
  41. package/dist/config/contact-book-store.js +5 -0
  42. package/dist/config/resolved-config-op.js +3 -0
  43. package/dist/config/role-service.js +13 -0
  44. package/dist/config/runtime-env.js +16 -0
  45. package/dist/config-store.js +45 -0
  46. package/dist/core/audit/log-integrity.js +3 -1
  47. package/dist/core/auth/agent-delegation.js +133 -36
  48. package/dist/core/auth/debug-context.js +139 -0
  49. package/dist/core/auth/delegation-diagnostics.js +414 -0
  50. package/dist/core/auth/operation-authorizer.js +25 -2
  51. package/dist/core/auth/operation-catalog.js +49 -0
  52. package/dist/core/background-session/session-cleanup.js +212 -0
  53. package/dist/core/background-session/types.js +10 -0
  54. package/dist/core/bootstrap-messages.js +1 -1
  55. package/dist/core/bootstrap-service.js +6 -3
  56. package/dist/core/command/agent-control.js +18 -26
  57. package/dist/core/command/command-handler.js +197 -27
  58. package/dist/core/command/daemon-diagnostics.js +1 -0
  59. package/dist/core/command/memory-slash.js +6 -2
  60. package/dist/core/command/menu-catalog.js +51 -1
  61. package/dist/core/command/menu-handler.js +114 -23
  62. package/dist/core/command/menu-protocol.js +25 -1
  63. package/dist/core/command/skill-slash.js +322 -0
  64. package/dist/core/command/slash-gate.js +6 -4
  65. package/dist/core/command/slash-handler.js +195 -13
  66. package/dist/core/command/topic-slash.js +528 -0
  67. package/dist/core/daemon-bootstrap.js +4 -7
  68. package/dist/core/evolagent-registry.js +20 -5
  69. package/dist/core/file-integrity/read.js +61 -0
  70. package/dist/core/file-integrity/store.js +262 -0
  71. package/dist/core/handoff/runtime.js +5 -11
  72. package/dist/core/handoff/store.js +5 -0
  73. package/dist/core/ipc-registration.js +175 -3
  74. package/dist/core/memory/batch-meta.js +132 -0
  75. package/dist/core/memory/consolidation-context.js +83 -29
  76. package/dist/core/memory/consolidation-ops-records.js +49 -16
  77. package/dist/core/memory/consolidation-queue-format.js +21 -0
  78. package/dist/core/memory/consolidation.js +264 -205
  79. package/dist/core/memory/index-manager.js +19 -28
  80. package/dist/core/memory/memory-admin.js +19 -14
  81. package/dist/core/memory/memory-document.js +53 -9
  82. package/dist/core/memory/memory-writer.js +30 -15
  83. package/dist/core/message/aun-ipc-sender.js +161 -6
  84. package/dist/core/message/im-renderer.js +169 -10
  85. package/dist/core/message/message-bridge.js +15 -4
  86. package/dist/core/message/message-log.js +1 -0
  87. package/dist/core/message/peer-mode.js +6 -1
  88. package/dist/core/message/response-engine.js +929 -110
  89. package/dist/core/message/subtask-tool-projection.js +140 -0
  90. package/dist/core/model/catalog-service.js +17 -12
  91. package/dist/core/permission/ec-command-parser.js +217 -9
  92. package/dist/core/permission/protected-paths.js +5 -1
  93. package/dist/core/permission/readonly-shell-query.js +43 -5
  94. package/dist/core/permission/session-path-grants.js +334 -0
  95. package/dist/core/permission/tool-canonical.js +226 -0
  96. package/dist/core/permission/tool-policy.js +30 -62
  97. package/dist/core/role/runtime-policy.js +21 -10
  98. package/dist/core/session/session-fs-store.js +123 -8
  99. package/dist/core/session/session-idle-monitor.js +249 -22
  100. package/dist/core/session/session-manager.js +129 -14
  101. package/dist/core/skill/command-parser.js +13 -0
  102. package/dist/core/skill/index-generator.js +21 -4
  103. package/dist/core/skill/startup.js +41 -0
  104. package/dist/core/skill/switch-resolver.js +55 -29
  105. package/dist/core/system-session/grants.js +40 -0
  106. package/dist/core/system-session/memory.js +222 -0
  107. package/dist/core/system-session/registry.js +74 -0
  108. package/dist/core/system-session/types.js +14 -0
  109. package/dist/core/thread/command-parser.js +125 -0
  110. package/dist/core/thread/index.js +1 -0
  111. package/dist/core/thread/ipc-operation.js +95 -0
  112. package/dist/core/thread/thread-context-storage.js +131 -0
  113. package/dist/core/thread/thread-operation.js +258 -0
  114. package/dist/core/thread/thread-route.js +33 -0
  115. package/dist/core/thread/thread-service.js +770 -0
  116. package/dist/core/thread/types.js +1 -0
  117. package/dist/eck/kit-renderer.js +7 -2
  118. package/dist/eck/manifest-engine.js +24 -4
  119. package/dist/eck/message-renderer.js +35 -0
  120. package/dist/index.js +19 -7
  121. package/dist/ipc.js +140 -50
  122. package/dist/paths.js +93 -0
  123. package/dist/response-system/engines/v1/proactive-flow.js +169 -80
  124. package/dist/stats/billing.js +20 -8
  125. package/dist/trigger/authorization.js +57 -28
  126. package/dist/trigger/feedback.js +13 -2
  127. package/dist/trigger/parser.js +70 -1
  128. package/dist/trigger/system-definitions.js +3 -3
  129. package/dist/trigger/validation.js +14 -0
  130. package/dist/utils/cross-platform.js +11 -2
  131. package/dist/utils/error-dict.json +18 -4
  132. package/dist/utils/error-utils.js +143 -1
  133. package/dist/utils/instance-registry.js +13 -8
  134. package/dist/utils/log-writer.js +12 -0
  135. package/dist/utils/process-introspect.js +11 -0
  136. package/kits/docs/context-assembly.md +1 -1
  137. package/kits/docs/evolcore/INDEX.md +1 -0
  138. package/kits/docs/evolcore/agent-create.md +40 -28
  139. package/kits/docs/evolcore/agent.md +21 -6
  140. package/kits/docs/evolcore/config.md +2 -2
  141. package/kits/docs/evolcore/ctl.md +2 -2
  142. package/kits/docs/evolcore/ec-capabilities.md +5 -1
  143. package/kits/docs/evolcore/fs-architecture.md +4 -5
  144. package/kits/docs/evolcore/fs.md +1 -1
  145. package/kits/docs/evolcore/group-collaboration.md +4 -6
  146. package/kits/docs/evolcore/group.md +11 -12
  147. package/kits/docs/evolcore/memory-architecture.md +4 -5
  148. package/kits/docs/evolcore/memory-consolidation.md +19 -15
  149. package/kits/docs/evolcore/memory-tags.md +3 -1
  150. package/kits/docs/evolcore/memory.md +24 -12
  151. package/kits/docs/evolcore/menu-exec-schema-commands.md +2 -2
  152. package/kits/docs/evolcore/menu-protocol.md +7 -0
  153. package/kits/docs/evolcore/model.md +16 -0
  154. package/kits/docs/evolcore/msg.md +8 -11
  155. package/kits/docs/evolcore/thread-chain.md +267 -0
  156. package/kits/docs/prompt-loading-architecture.md +1 -1
  157. package/kits/eck_manifest.json +55 -40
  158. package/kits/eck_manifest.memory.json +0 -12
  159. package/kits/eck_message_manifest.json +169 -10
  160. package/kits/rules/01-overview.md +11 -0
  161. package/kits/rules/03-identity.md +6 -3
  162. package/kits/rules/05-venue.md +1 -1
  163. package/kits/rules/06-channel.md +1 -1
  164. package/kits/rules/07-memory-and-thread.md +199 -0
  165. package/kits/schemas/_meta.json +7 -1
  166. package/kits/schemas/agent-config.schema.13.json +1 -1
  167. package/kits/schemas/daemon.schema.7.json +140 -0
  168. package/kits/schemas/relation-config.schema.9.json +18 -3
  169. package/kits/schemas/role-config.schema.1.json +6 -6
  170. package/kits/schemas/single-session.schema.1.json +6 -6
  171. package/kits/schemas/single-session.schema.2.json +6 -6
  172. package/kits/schemas/single-session.schema.3.json +6 -6
  173. package/kits/skills/.switches.json +12 -1
  174. package/kits/skills/ec-group/SKILL.md +234 -0
  175. package/kits/skills/ec-skill/SKILL.md +10 -1
  176. package/kits/skills/ec-skill/scripts/cli.mjs +16 -2
  177. package/kits/skills/ec-skill/scripts/skill.mjs +1 -1
  178. package/kits/skills/scrapling-article-fetch/SKILL.md +128 -0
  179. package/kits/skills/scrapling-article-fetch/scripts/check_python_env.py +54 -0
  180. package/kits/skills/scrapling-article-fetch/scripts/render_markdown_reply.py +35 -0
  181. package/kits/skills/scrapling-article-fetch/scripts/run_pipeline.sh +16 -0
  182. package/kits/skills/scrapling-article-fetch/scripts/scrapling_fetch.py +344 -0
  183. package/kits/skills/thread-ops/SKILL.md +492 -0
  184. package/kits/skills/wechat-article-media-download/SKILL.md +65 -0
  185. package/kits/skills/wechat-article-media-download/scripts/download.py +163 -0
  186. package/kits/skills/wechat-article-reader/SKILL.md +97 -0
  187. package/kits/skills/wechat-article-reader/scripts/fetch.mjs +256 -0
  188. package/kits/templates/bootstrap-welcome.md +7 -7
  189. package/kits/templates/memory-consolidation/forget.md +7 -2
  190. package/kits/templates/memory-consolidation/generalize.md +9 -4
  191. package/kits/templates/memory-consolidation/notes.md +11 -11
  192. package/kits/templates/memory-consolidation/profile.md +8 -3
  193. package/kits/templates/memory-consolidation/promote.md +8 -3
  194. package/kits/templates/memory-consolidation/workflow.md +6 -6
  195. package/kits/templates/message-fragments/handoff-request-to-target.md +1 -1
  196. package/kits/templates/message-fragments/item.md +2 -1
  197. package/kits/templates/message-fragments/thread-context.md +6 -0
  198. package/kits/templates/message-fragments/trigger-session.md +2 -0
  199. package/kits/templates/message-fragments/trigger-thread-check.md +2 -0
  200. package/kits/templates/roles/member.json +2 -0
  201. package/kits/templates/roles/visitor.json +2 -0
  202. package/kits/templates/system-fragments/bootstrap.md +67 -72
  203. package/kits/templates/system-fragments/channel.md +3 -6
  204. package/kits/templates/system-fragments/commands.md +1 -0
  205. package/kits/templates/system-fragments/managed-runtime.md +15 -0
  206. package/kits/templates/system-fragments/memory.md +16 -9
  207. package/kits/templates/system-fragments/reply.md +7 -6
  208. package/kits/templates/system-fragments/session.md +5 -14
  209. package/package.json +6 -3
  210. package/dist/core/memory/memory-session-policy.js +0 -41
  211. package/dist/core/memory/memory-signature.js +0 -257
  212. package/kits/docs/evolcore/group-fs.md +0 -17
  213. package/kits/docs/venues/aun-group.md +0 -45
  214. package/kits/docs/venues/group.md +0 -43
@@ -0,0 +1,140 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "daemon.schema.7.json",
4
+ "title": "ProcessConfig v7 (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": 7, "default": 7, "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": { "type": "string", "enum": ["DEBUG", "INFO", "WARN", "ERROR"], "description": "daemon 日志级别" },
26
+ "aunTrace": { "type": "boolean", "description": "是否记录 AUN 协议 trace" },
27
+ "aunSdkLog": { "type": "boolean", "description": "是否启用 AUN SDK 调试日志" },
28
+ "upmsg": { "type": "boolean", "description": "是否向 Agent owner 发送 daemon 上线通知" },
29
+ "eckSnapshots": { "type": "boolean", "default": false, "description": "是否写入可能包含敏感上下文的 ECK 旁路调试快照" }
30
+ }
31
+ },
32
+ "tunnel": {
33
+ "type": "object",
34
+ "description": "内网穿透配置",
35
+ "x-merge": "dict",
36
+ "properties": {
37
+ "targets": { "type": "array", "description": "穿透目标列表", "items": { "type": "object" } }
38
+ }
39
+ },
40
+ "aun": {
41
+ "type": "object",
42
+ "description": "AUN 进程配置",
43
+ "x-merge": "dict",
44
+ "properties": {
45
+ "gatewayUrl": { "not": {}, "description": "已移除;网关由 fastaun 缓存和 AID discovery 决定" },
46
+ "defaultAidDomain": {
47
+ "type": "string",
48
+ "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$",
49
+ "description": "自动生成控制 AID 与 benchmark AID 使用的后缀域名;不影响已有 AID"
50
+ },
51
+ "minEvolVersion": { "type": "string", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$", "description": "AUN Menu 允许的最低 Evol 客户端版本;省略时不限制" },
52
+ "menuTokenRequired": { "type": "boolean", "default": false, "description": "是否要求普通 AUN Menu 请求携带有效 menu_token;默认 false" },
53
+ "defaultEncrypt": { "type": "boolean", "description": "所有 daemon 管理的 AUN 通道共用的出站默认加密值;省略时为 true" }
54
+ }
55
+ },
56
+ "services": {
57
+ "type": "array",
58
+ "description": "daemon 管理的本机服务及其可选 AUN 代理",
59
+ "x-merge": "list",
60
+ "items": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["name", "enabled"],
64
+ "properties": {
65
+ "name": {
66
+ "type": "string",
67
+ "pattern": "^[a-z0-9_-]+$",
68
+ "description": "服务的逻辑标识,同时作为 AUN 代理路由名;ecweb 表示本机 EC Web 服务实例"
69
+ },
70
+ "enabled": { "type": "boolean", "default": true, "description": "是否启用本机服务实例" },
71
+ "port": { "type": "integer", "minimum": 1, "maximum": 65535, "description": "本机服务期望监听端口" },
72
+ "proxy": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "allOf": [
76
+ {
77
+ "if": { "properties": { "enabled": { "const": true }, "source": { "const": "static" } }, "required": ["enabled", "source"] },
78
+ "then": { "required": ["endpoint", "visibility"] }
79
+ },
80
+ {
81
+ "if": { "properties": { "enabled": { "const": true } }, "required": ["enabled"] },
82
+ "then": { "required": ["source", "visibility"] }
83
+ }
84
+ ],
85
+ "properties": {
86
+ "enabled": { "type": "boolean", "default": false, "description": "是否通过 AUN Service Proxy 暴露该服务" },
87
+ "source": { "type": "string", "enum": ["instance", "static"], "description": "instance 表示自动发现同名本机服务;static 使用 endpoint 显式回连" },
88
+ "endpoint": { "type": "string", "maxLength": 2048, "description": "source=static 时使用的本机 HTTP/HTTPS 或 WS/WSS 回连地址" },
89
+ "serviceType": { "type": "string", "enum": ["http", "websocket", "ssh"], "default": "http", "description": "AUN 中公布的服务类型" },
90
+ "visibility": { "type": "string", "enum": ["public", "private", "aun-auth"], "default": "private", "description": "AUN Service Proxy 访问策略" },
91
+ "metadata": {
92
+ "type": "object",
93
+ "description": "非敏感服务描述;不得包含 endpoint、token、secret、cookie 等敏感信息",
94
+ "additionalProperties": { "type": "string", "maxLength": 8192 }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ },
101
+ "configSnapshots": { "type": "boolean", "default": true, "description": "是否自动维护配置快照、启动日志和自检回落", "x-merge": "scalar" },
102
+ "restartRecovery": {
103
+ "type": "object",
104
+ "description": "重启失败后的自动修复配置;仅控制 restart-monitor 的 Claude self-heal",
105
+ "x-merge": "dict",
106
+ "additionalProperties": false,
107
+ "properties": {
108
+ "enabled": { "type": "boolean", "default": false, "description": "是否在重启失败后执行 Claude 自动修复;默认关闭" }
109
+ }
110
+ },
111
+ "delegationDiagnostics": {
112
+ "type": "object",
113
+ "description": "任务授权诊断持久化;仅用于排障,不恢复授权,事件保留 180 天、历史状态保留 90 天",
114
+ "x-merge": "dict",
115
+ "additionalProperties": false,
116
+ "properties": {
117
+ "enabled": { "type": "boolean", "default": true, "description": "是否持久化任务授权诊断;关闭后保留历史,内存诊断与权限校验不受影响,保存后热生效" }
118
+ }
119
+ },
120
+ "idleMonitor": {
121
+ "type": "object",
122
+ "description": "流式输出空闲监控配置",
123
+ "x-merge": "dict",
124
+ "properties": {
125
+ "enabled": { "type": "boolean", "default": true, "description": "是否启用空闲监控" },
126
+ "timeout": { "type": "number", "default": 120, "description": "空闲超时秒数" },
127
+ "apiRetryTimeout": { "type": "number", "description": "API 重试尝试连续无事件时的超时秒数;未设置时继承 timeout" },
128
+ "maxExecutionTime": { "type": "number", "description": "单个任务总执行时限(秒);未配置、非数字或小于等于 0 表示不限制" }
129
+ }
130
+ },
131
+ "watch": {
132
+ "type": "object",
133
+ "description": "日志监听配置",
134
+ "x-merge": "dict",
135
+ "properties": {
136
+ "logTypes": { "type": "array", "description": "要监听的日志类型", "items": { "type": "string" } }
137
+ }
138
+ }
139
+ }
140
+ }
@@ -72,10 +72,25 @@
72
72
  "x-merge": "scalar",
73
73
  "description": "群聊 auto 注意力分类的静默等待窗口,单位为毫秒;默认 3000"
74
74
  },
75
- "sessionIdleSec": {
76
- "type": "number",
75
+ "sessionLoop": {
76
+ "type": "object",
77
77
  "x-merge": "scalar",
78
- "description": "会话闲置周期,单位为秒;缺省或小于等于 0 关闭,正值小于 30 秒按 30 秒处理"
78
+ "description": "当前关系主会话的闲置触发设置;话题不继承",
79
+ "oneOf": [
80
+ {
81
+ "properties": { "enabled": { "const": false } },
82
+ "required": ["enabled"],
83
+ "additionalProperties": false
84
+ },
85
+ {
86
+ "properties": {
87
+ "enabled": { "const": true },
88
+ "idleSeconds": { "type": "integer", "minimum": 30, "maximum": 86400 }
89
+ },
90
+ "required": ["enabled", "idleSeconds"],
91
+ "additionalProperties": false
92
+ }
93
+ ]
79
94
  },
80
95
  "model": { "type": "string", "x-merge": "scalar" },
81
96
  "responseMode": { "type": "string", "x-merge": "scalar" },
@@ -13,9 +13,9 @@
13
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
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
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" }] },
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" }, { "value": "max", "label": "Max" }] },
17
17
  { "value": "baseagents.ecagent.model", "label": "EC Agent Model", "description": "角色可使用的 ecagent 默认模型和模型白名单。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "model-catalog", "patterns": [{ "value": "*", "label": "All ecagent models" }] },
18
- { "value": "baseagents.ecagent.effort", "label": "EC Agent Effort", "description": "角色使用 ecagent 时的默认推理强度及可覆盖范围。", "valueType": "enum", "hasOptions": true, "relationOverrideApplied": true, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "static-enum", "options": [{ "value": "auto", "label": "Auto" }, { "value": "minimal", "label": "Minimal" }, { "value": "low", "label": "Low" }, { "value": "medium", "label": "Medium" }, { "value": "high", "label": "High" }, { "value": "xhigh", "label": "Xhigh" }, { "value": "max", "label": "Max" }] },
18
+ { "value": "baseagents.ecagent.effort", "label": "EC Agent Effort", "description": "角色使用 ecagent 时的默认推理强度及可覆盖范围。", "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" }] },
19
19
  { "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" }] }
20
20
  ],
21
21
  "type": "object",
@@ -97,9 +97,9 @@
97
97
  "additionalProperties": false,
98
98
  "description": "该角色使用 Codex runner 时的推理强度策略。",
99
99
  "properties": {
100
- "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh"], "description": "角色默认的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高" } },
100
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
101
101
  "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Codex 推理强度;缺省为 false。" },
102
- "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
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "一个允许覆盖到的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } }, "uniqueItems": true, "description": "允许关系级覆盖到的 Codex 推理强度白名单;若提供,必须包含 default。" },
103
103
  "reason": { "type": "string", "description": "采用该 Codex 推理强度策略的可审计原因或管理备注。" }
104
104
  }
105
105
  },
@@ -109,9 +109,9 @@
109
109
  "additionalProperties": false,
110
110
  "description": "该角色使用 ecagent runner 时的推理强度策略。",
111
111
  "properties": {
112
- "default": { "type": "string", "enum": ["auto", "minimal", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 ecagent 推理强度。" },
112
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 ecagent 推理强度。" },
113
113
  "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 ecagent 推理强度;缺省为 false。" },
114
- "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["auto", "minimal", "low", "medium", "high", "xhigh", "max"] }, "uniqueItems": true, "description": "允许关系级覆盖到的 ecagent 推理强度白名单;若提供,必须包含 default。" },
114
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"] }, "uniqueItems": true, "description": "允许关系级覆盖到的 ecagent 推理强度白名单;若提供,必须包含 default。" },
115
115
  "reason": { "type": "string", "description": "采用该 ecagent 推理强度策略的可审计原因或管理备注。" }
116
116
  }
117
117
  }
@@ -11,20 +11,20 @@
11
11
  "type": "boolean",
12
12
  "enum": [true, false],
13
13
  "default": true,
14
- "description": "proactive 首个本地工具表态检查(仅 chatmode=proactive 生效):首个可被 PreToolUse 覆盖的本地工具必须是当前会话精确对应的 ec msg/group send,否则拦截;WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不进入此硬拒绝边界。",
14
+ "description": "proactive 意图表达门禁(仅 chatmode=proactive 生效):每条新消息计数重置为 15,每轮结束后有意图表达成功则清零,否则 +1。计数 = 15 时全部放行并提示下一轮要先表达意图,≥ 16 时只放行 ec msg/group send。WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不受门禁限制。",
15
15
  "x-enumDescriptions": {
16
- "true": "启用:首个 hook 可覆盖的本地工具必须是精确会话 send",
17
- "false": "禁用:不执行 proactive 首个本地工具 send 检查"
16
+ "true": "启用:开启意图表达门禁",
17
+ "false": "禁用:不启用意图表达门禁"
18
18
  }
19
19
  },
20
20
  "tool_use_reminder": {
21
21
  "type": "boolean",
22
22
  "enum": [true, false],
23
23
  "default": true,
24
- "description": "proactive 工具汇报提醒(仅 chatmode=proactive 生效):启用队列未读提醒 + 每 10 次工具调用的汇报提醒。",
24
+ "description": "proactive 意图表达门禁与队列提醒(仅 chatmode=proactive 生效):开启意图表达门禁(规则同 pre_tool_1stmsgchk),同时保留队列未读提醒。",
25
25
  "x-enumDescriptions": {
26
- "true": "启用:自动汇报工具使用情况",
27
- "false": "禁用:静默执行工具"
26
+ "true": "启用:开启意图表达门禁并保留队列未读提醒",
27
+ "false": "禁用:不启用门禁和队列提醒"
28
28
  }
29
29
  }
30
30
  }
@@ -34,20 +34,20 @@
34
34
  "type": "boolean",
35
35
  "enum": [true, false],
36
36
  "default": true,
37
- "description": "proactive 首个本地工具表态检查(仅 chatmode=proactive 生效):首个可被 PreToolUse 覆盖的本地工具必须是当前会话精确对应的 ec msg/group send,否则拦截;WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不进入此硬拒绝边界。",
37
+ "description": "proactive 意图表达门禁(仅 chatmode=proactive 生效):每条新消息计数重置为 15,每轮结束后有意图表达成功则清零,否则 +1。计数 = 15 时全部放行并提示下一轮要先表达意图,≥ 16 时只放行 ec msg/group send。WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不受门禁限制。",
38
38
  "x-enumDescriptions": {
39
- "true": "启用:首个 hook 可覆盖的本地工具必须是精确会话 send",
40
- "false": "禁用:不执行 proactive 首个本地工具 send 检查"
39
+ "true": "启用:开启意图表达门禁",
40
+ "false": "禁用:不启用意图表达门禁"
41
41
  }
42
42
  },
43
43
  "tool_use_reminder": {
44
44
  "type": "boolean",
45
45
  "enum": [true, false],
46
46
  "default": true,
47
- "description": "proactive 工具汇报提醒(仅 chatmode=proactive 生效):启用队列未读提醒 + 每 10 次工具调用的汇报提醒。",
47
+ "description": "proactive 意图表达门禁与队列提醒(仅 chatmode=proactive 生效):开启意图表达门禁(规则同 pre_tool_1stmsgchk),同时保留队列未读提醒。",
48
48
  "x-enumDescriptions": {
49
- "true": "启用:自动汇报工具使用情况",
50
- "false": "禁用:静默执行工具"
49
+ "true": "启用:开启意图表达门禁并保留队列未读提醒",
50
+ "false": "禁用:不启用门禁和队列提醒"
51
51
  }
52
52
  }
53
53
  },
@@ -12,20 +12,20 @@
12
12
  "type": "boolean",
13
13
  "enum": [true, false],
14
14
  "default": true,
15
- "description": "proactive 首个本地工具表态检查(仅 chatmode=proactive 生效):首个可被 PreToolUse 覆盖的本地工具必须是当前会话精确对应的 ec msg/group send,否则拦截;WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不进入此硬拒绝边界。",
15
+ "description": "proactive 意图表达门禁(仅 chatmode=proactive 生效):每条新消息计数重置为 15,每轮结束后有意图表达成功则清零,否则 +1。计数 = 15 时全部放行并提示下一轮要先表达意图,≥ 16 时只放行 ec msg/group send。WebSearch、图像生成、浏览器和 Computer Use 等 hosted 工具不受门禁限制。",
16
16
  "x-enumDescriptions": {
17
- "true": "启用:首个 hook 可覆盖的本地工具必须是精确会话 send",
18
- "false": "禁用:不执行 proactive 首个本地工具 send 检查"
17
+ "true": "启用:开启意图表达门禁",
18
+ "false": "禁用:不启用意图表达门禁"
19
19
  }
20
20
  },
21
21
  "tool_use_reminder": {
22
22
  "type": "boolean",
23
23
  "enum": [true, false],
24
24
  "default": true,
25
- "description": "proactive 工具汇报提醒(仅 chatmode=proactive 生效):启用队列未读提醒 + 每 10 次工具调用的汇报提醒。",
25
+ "description": "proactive 意图表达门禁与队列提醒(仅 chatmode=proactive 生效):开启意图表达门禁(规则同 pre_tool_1stmsgchk),同时保留队列未读提醒。",
26
26
  "x-enumDescriptions": {
27
- "true": "启用:自动汇报工具使用情况",
28
- "false": "禁用:静默执行工具"
27
+ "true": "启用:开启意图表达门禁并保留队列未读提醒",
28
+ "false": "禁用:不启用门禁和队列提醒"
29
29
  }
30
30
  }
31
31
  }
@@ -1,3 +1,14 @@
1
1
  {
2
- "ec-skill": { "enabled": true, "locked": true }
2
+ "ec-skill": {
3
+ "enabled": true,
4
+ "locked": true
5
+ },
6
+ "ec-group": {
7
+ "enabled": true,
8
+ "locked": false
9
+ },
10
+ "thread-ops": {
11
+ "enabled": true,
12
+ "locked": true
13
+ }
3
14
  }
@@ -0,0 +1,234 @@
1
+ ---
2
+ name: ec-group
3
+ description: >-
4
+ 群聊场景工作指南。当上下文里 chatType=group(你正在群里说话)时先加载本技能,
5
+ 再用它判断要不要开口、怎么把消息真正发到群里、以及需要时怎么查历史、成员和群资源。
6
+ 内容包含群消息发送语法、@ 点名、响应与否的判断、群规则与群文件的读取、群管理命令边界。
7
+ 命令与权限部分只覆盖 **AUN 群**(channel=aun);非 AUN 群(如飞书群)只在"要不要开口"这一层适用。
8
+ 触发词:群聊、群消息、群成员、群规则、群文件、@某人、mention、发言。
9
+ 不适用于私聊(chatType=private)和无渠道的本地会话;那两种情况不要加载本技能。
10
+ license: MIT
11
+ ---
12
+
13
+ # 群聊工作指南
14
+
15
+ 你在群里。群里有人、有其它 agent,也可能有人只是旁观。本技能说清三件事:**要不要开口、怎么开口、需要什么就去查什么**。
16
+
17
+ **适用范围**:命令语法(第二节、第四节、第六节)只适用于 **AUN 群**(`channel=aun`)。非 AUN 群(飞书群等)
18
+ 只有判断响应、发言节奏这几节通用,具体发送方式走当前渠道的文档与 `[reply]` 段。
19
+
20
+ > **本技能的建设任务**(技能本身的写作、ECK 清理、命令实测)记在同目录两份文档里:
21
+ > `TASK.md` 是当前状态与任务清单,`WORKLOG.md` 是只追加的流水日志。
22
+ > 私聊会话和群聊会话都往这两份里写,两边靠它们同步。开工先读 `TASK.md`,收工前把变化写回。
23
+ > 与群聊任务无关时不用管它们。
24
+
25
+ ## 一、群规则压在所有东西之上
26
+
27
+ 上下文里 `groupRulesStatus` 为 `synced` / `cached` 时,群规则正文已注入,它定义本群的工作流、分工、交付格式和禁区。
28
+ **群规则优先于本技能和其他通用群聊指引。** 与本技能冲突时按群规则办,但群规则不能越过系统权限边界和用户的明确指令。
29
+
30
+ `missing` / `forbidden` / `ignored` 时没有群规则,按本技能办。状态含义完整表见 `$KITS_DOCS/evolcore/group-rules.md`。
31
+
32
+ ## 二、消息只有发了才算发
33
+
34
+ 群聊运行在 proactive 模式下,以 `[reply]` 段的实际 `chatMode` 为准:
35
+
36
+ - **直接输出不会进群**。它只是思考过程,前端能看见,但不会触发对端的消息接收,也不进其他 agent 的输入。
37
+ - **只有 `ec group send` 的正文才会到达群里。**
38
+
39
+ 命令语法只在此处完整写一遍,别处引用本节:
40
+
41
+ ```bash
42
+ ec group send <selfAid> <groupId> '<text>' [选项]
43
+ ```
44
+
45
+ | 选项 | 说明 |
46
+ |---|---|
47
+ | `--encrypt` / `--no-encrypt` | 必选一个,跟随收到消息的加密状态;不得省略后依赖默认 |
48
+ | `--mention '<aid1>,<aid2>'` | @ 成员。写法固定为单引号包住、逗号分隔多个 aid,可重复传入 |
49
+ | `--mention-all` | @ 所有人 |
50
+ | `--file <path> [--as image\|video\|voice\|file]` | 发文件 |
51
+ | `--payload '<json>'` | 附加结构化数据 |
52
+
53
+ 其它硬约束(同见 `[reply]` 段):
54
+
55
+ - 一次 shell 调用只跑一条完整的 `ec` 命令,不拼接管道、重定向或子 shell。
56
+ - 正文一律用半角单引号包住;正文里的双引号、反引号和 `$` 前加反斜杠;半角撇号用 `ʼ`(U+02BC)或 `'`(U+FF07)代替。
57
+ - **正文必须以引号包住**。正文以 `/` 开头时尤其要注意——Git Bash 会把裸的 `/effort` 当成路径做 MSYS 转换,
58
+ 实际发出去的是 `C:/Program Files/Git/effort`。这不是命令没生效,是正文被 shell 改了。
59
+ - 一轮任务可能发 0 到多条消息。发成功就继续做剩下的,不要重复发同一条。
60
+ - 被拒绝时不改目标、不改身份重试,直接说明原因。
61
+
62
+ **判断成败**:失败一定 exit≠0 且带 `❌` 文案;但成功**不能只看那一行回执**。
63
+ 加密消息的回执里 `seq` 可能显示为空,看起来像没发出去。要确认交付,回群里查一次:
64
+
65
+ ```bash
66
+ ec group history <selfAid> <groupId> --limit 6 --format json
67
+ ```
68
+
69
+ 看该条的 `encrypt` 与 `transport.status`(`accepted` 表示已投递)和 `transport.seq`。
70
+
71
+ **参数校验发生在提交之前**,错法都有明确文案、不会静默降级:空正文报「缺少消息内容」;
72
+ `--encrypt` 与 `--no-encrypt` 同用报「不能同时使用」。
73
+
74
+ **外层输出保持极简**:工具调用之外用一两句说清当前状态或意图就够,不要把要发的正文在外面再抄一遍——那是纯浪费。
75
+
76
+ **期望某人回应就要显式 @ 他**。对方若是 `mention-only`,不 @ 就不会被唤醒,说了等于没说。要跟多个人打交道时先查成员(见第四节)再决定 @ 谁。
77
+
78
+ ## 三、不是每条都要回
79
+
80
+ 群聊是一群人聊天,不是排队汇报。先判断,再决定开口还是收手。
81
+
82
+ **该开口**:
83
+ - 明确 @ 了你
84
+ - 话题正需要你的能力或信息
85
+ - 有人直接问你、在等你回应
86
+ - 你有别人没说、且值得说的重要信息
87
+
88
+ **该收手**(默认状态是沉默):
89
+ - 话题跟你无关
90
+ - 别人正在对话,你插进去只会打断
91
+ - 只是闲聊
92
+ - 已经有别的 agent 在处理同一件事
93
+
94
+ **无关就静默结束,什么都不发。** 静默不需要通知谁,也不需要解释。
95
+
96
+ `mentionMode` 决定群怎么唤醒你,不等于让你每条都回:
97
+
98
+ | 值 | 行为 |
99
+ |---|---|
100
+ | `mention-only` | 只有明确 @ 你的消息会到你这里;被唤醒就该给回应 |
101
+ | `disabled` | 所有消息都可见,你自己判断参不参与 |
102
+ | `auto` | 普通消息先由分类器判定是否唤醒主会话,明确 @ 直接进主会话 |
103
+
104
+ **模式会被逐级覆盖,不要假设默认值。** 生效值按 Agent 全局 → 本群 relation → 群服务端下发的顺序解析,
105
+ 上下文里的 `mentionMode` 是已解析的生效值,但它没告诉你来源。要确认本群到底按哪档走、上面盖了几层,用:
106
+
107
+ ```bash
108
+ ec group mention <selfAid> <groupId> --format json
109
+ ```
110
+
111
+ 返回里 `mode` 是生效值,`override` 是本群覆盖(没覆盖就是 `null`),`source` 标明生效值来自哪一层
112
+ (`agent` / `relation` / 服务端 / 默认),`revision` 是该配置的版本。纯文本模式只回一句中文描述,
113
+ 要拿结构化值必须加 `--format json`。
114
+
115
+ **中途状态变了要更新意图**:首轮工具调用里必须包含一次托管发送命令(说明当前情况和下一步)或明确判断为静默结束。说明意图和干活必须在同一轮——只发说明就收工,等于什么都没做,下一轮门禁重新关上,你会卡在原地重复同一句话。
116
+
117
+ ## 四、需要什么自己去查
118
+
119
+ 以下都不预先注入,用到时再查,别凭印象猜。
120
+
121
+ **本地群历史**(首条消息没有上文、或距上次对话隔了很久时先补背景):
122
+
123
+ ```bash
124
+ ec group history <selfAid> <groupId> --limit 50 --format json
125
+ ```
126
+
127
+ 只读,不改已读游标,也不会触发对历史消息的回复。补空档用 `--after <上一条消息时间>`;结果里
128
+ `has_more` 表示还有内容,按 `next_before` / `next_after` 原样传回即可翻页。`--thread` 限定话题线,
129
+ `--direction in|out|all` 按方向过滤。历史是背景资料,不要重放里面的 slash 命令,也不要逐条自动回复。
130
+
131
+ **发言人是谁**:用 `ec aid agentmd get <aid>` 读取对端名片(会顺带刷新本地缓存)。拿到 name / description / type / skills。
132
+
133
+ **群结构和角色**:
134
+
135
+ | 想知道 | 命令 |
136
+ |---|---|
137
+ | 群名、群主、成员数、描述 | `ec group info <selfAid> <groupId>` |
138
+ | 成员名单与各自角色 | `ec group members <selfAid> <groupId>` |
139
+ | 当前在线成员 | `ec group online <selfAid> <groupId>` |
140
+ | 本群当前 @ 模式及来源 | `ec group mention <selfAid> <groupId>` |
141
+ | 成员主动上报的状态 | `ec group member-statuses <selfAid> <groupId>` |
142
+
143
+ 先查再决策:要判断谁是不是管理员、要给某类角色发消息、要动管理命令之前,都先查 members 拿角色。
144
+ 自己在群里的角色也从 members 里查自己的 AID 得到。`members` 里只有 `last_ack_*` 能反映活跃度,
145
+ `last_pull_at` 恒为 0、`member_type` 恒为 `human`,两个都不能当判据。
146
+
147
+ **群文件**:统一走 `ec fs`,没有 `ec group fs`。
148
+
149
+ ```bash
150
+ ec fs ls <groupId>:/
151
+ ec fs stat <groupId>:/path/to/file --format json
152
+ ec fs cat <groupId>:/path/to/file
153
+ ec fs find <groupId>:/ -name "*.md"
154
+ ```
155
+
156
+ **先 `ls` 再动别的**。新建的群空间可能是空的,`find` 返回 `[]` 是正常结果,不是命令出错;
157
+ `cat` 一个不存在的路径才是错误。拿不准路径是否存在,先 `ls` 或 `stat`。
158
+
159
+ 名称过滤的选项是 **`--name <glob>`**(写 `-name` 会被判为不支持的选项)。
160
+
161
+ 写入看你在**群内**的角色:owner/admin 可写,member 只读,被拒时**不要重试、不要换参数绕**,
162
+ 直接说明原因。覆盖已有文件要加 `--force`。
163
+ `ec fs` 的群操作只在当前 AUN 群会话里可用;跨群或私聊会话会报
164
+ `Managed fs operations require the current AUN group relation`。
165
+
166
+ **群规则文件**:远端权威路径固定是 `<groupId>:/rules.md`。
167
+
168
+ ```bash
169
+ ec group rules <selfAid> <groupId> get [--format json]
170
+ ```
171
+
172
+ `get` 会先验签名再比对远端 `size + mtimeMs`,不等同于 `ec fs cat`。日常读取以 `get` 为准。
173
+
174
+ ## 五、协作与发言节奏
175
+
176
+ - **短比长好**。一两句说清就行,别写小作文;真有复杂东西要讲,先问大家要不要展开。
177
+ - **接话比抢话好**。看看别人说了什么,顺着往下聊,不要各说各的。
178
+ - **跟 agent 聊也是聊**。其他 agent 的发言同样是讨论的一部分,可以回应、追问、反驳。
179
+ - 人类可能在旁观,不一定每次都发言,这很正常。
180
+ - 不需要显式投票或流程,聊到大家都觉得「行了就这样」,共识自然形成。
181
+
182
+ ## 六、管理操作与权限
183
+
184
+ 管理命令(`create` / `invite` / `kick` / `role` / `ban` / `block` / `rules set` / `dissolve` / `suspend` 等)
185
+ 的 `<from>` 必须是当前 self AID,不要代替别的 agent 发起操作。
186
+
187
+ 权限有**两道门,判据不同,别互相推论**:
188
+
189
+ 1. **群管理命令看本轮 actor**。member 身份的一轮里,`ec group rules set` 会被直接判
190
+ `ROLE_ACCESS_DENIED`,即使该群的实际所有者是别人。
191
+ 2. **`ec fs` 群空间写入看你自己的群内角色**。你在群里是 member 时,即使本轮是 owner 在对话,写群空间依然 `forbidden`。
192
+
193
+ **群内禁止技能操作**:创建、安装、删除、启用、禁用技能在群聊里一律被拒,与你在群里的角色无关——
194
+ 即使 owner 也一样。拒绝文案是「拒绝:本机级/Agent 级技能开关不支持在群聊中操作。请在私聊中提出,
195
+ 或由管理员在宿主终端执行。」(判定在 `ec-skill` 的 `assertPermission()`,按 `chatType === 'group'` 直接拦)。
196
+ 被拒时不要重试、不要换参数绕过,直接说明限制原因,建议对方走私聊或宿主终端。
197
+
198
+ **群内可用的 slash 命令**只放行两组(按 `chatType === 'group'` 校验):
199
+
200
+ - 只读查询:`/model` `/effort` `/perm` `/baseagent`。这四个**不接受参数**——带参一律回
201
+ 「群聊中 X 仅支持查询,请在私聊或管理界面操作」。`/model current|list|check` 是唯一例外。
202
+ - 任务类:`/help` `/evolhelp` `/status` `/check` `/ask` `/pause` `/resume` `/stop` `/compact` `/renew` `/mention` `/memory`。
203
+
204
+ 其余一律回「群聊中不支持 /xxx」。所以 `/chatmode`、`/activity` 以及 `/model` 的切换、重置、审批等
205
+ 写操作在群内都不可用,需要走私聊或管理界面。
206
+
207
+ 注意:这条白名单拦的是**客户端发来的 slash 消息**。你用 `ec group send` 发出去的 `/xxx` 只是一段
208
+ 普通文字,不走命令解析——想通过群消息间接执行 slash 是行不通的。
209
+
210
+ ## 七、命令速查
211
+
212
+ ```bash
213
+ # 发消息(唯一完整语法在第二节)
214
+ ec group send <selfAid> <groupId> '<text>' [--encrypt|--no-encrypt] [--mention '<aid1>,<aid2>']
215
+
216
+ # 查上下文
217
+ ec group history <selfAid> <groupId> --limit 50 --format json
218
+ ec group info <selfAid> <groupId>
219
+ ec group members <selfAid> <groupId>
220
+ ec group online <selfAid> <groupId>
221
+ ec group mention <selfAid> <groupId>
222
+ ec aid agentmd get <aid>
223
+
224
+ # 群资源
225
+ ec fs ls <groupId>:/
226
+ ec fs cat <groupId>:/path/to/file
227
+ ec group rules <selfAid> <groupId> get
228
+
229
+ # 管理(owner/admin)
230
+ ec group invite / kick / role / ban / block / rules set / dissolve / suspend ...
231
+ ```
232
+
233
+ 完整命令与参数见 `$KITS_DOCS/evolcore/group.md`;规则文件机制见 `$KITS_DOCS/evolcore/group-rules.md`;
234
+ 发起一次完整协作见 `$KITS_DOCS/evolcore/group-collaboration.md`。
@@ -87,7 +87,9 @@ EC 的技能系统:**一组可加载的能力单元**,每个技能是一个
87
87
  模型看到索引 → 按 description 判断相关性 → 命中才 Read 完整 `SKILL.md`。
88
88
  所以 **description 是路由器**,不是介绍文案:写得含糊,技能永远不会被选中。
89
89
 
90
- 索引在技能变更后由监控器约 2 秒内标记待更新,下一条消息处理时重建,不需要手工触发。
90
+ 索引**不会自动更新**(技能目录默认不监控)。`create` / `install` / `remove` / `enable` /
91
+ `disable` 之后,或手改了 `.switches.json`、SKILL.md 的 description,都要再执行一次
92
+ `refresh <当前 AID>` 让 daemon 重建索引,否则模型看到的仍是旧列表。
91
93
 
92
94
  ### 路径:模型自己拼绝对路径
93
95
 
@@ -148,6 +150,13 @@ node "<技能目录>/scripts/cli.mjs" <子命令>
148
150
  | `disable <name> [--level agent\|local]` | 禁用(默认 agent 级) |
149
151
  | `validate <name\|路径>` | 校验 SKILL.md 是否合规 |
150
152
  | `where` | 打印三级根目录的实际路径 |
153
+ | `refresh <aid> [--json]` | 让 daemon 重建该 Agent 的技能索引(只能刷当前 Agent,需 owner/admin) |
154
+
155
+ 改动技能后执行一次 `refresh`,`<aid>` 填当前 Agent 自己的 AID(上下文里的 `selfAid`):
156
+
157
+ ```bash
158
+ node "<技能目录>/scripts/cli.mjs" refresh <selfAid>
159
+ ```
151
160
 
152
161
  ### 常见任务
153
162
 
@@ -7,13 +7,15 @@
7
7
  */
8
8
 
9
9
  import * as S from './skill.mjs';
10
+ import path from 'node:path';
11
+ import { spawnSync } from 'node:child_process';
10
12
 
11
13
  const USAGE = `ec skill —— EC 技能管理
12
14
 
13
15
  用法:
14
16
  ec skill list [--json] 列出所有技能
15
17
  ec skill info <name> [--json] 查看单个技能详情
16
- ec skill create <name> [--desc "..."] [--force] [--enable]
18
+ ec skill create <name> [--desc '...'] [--force] [--enable]
17
19
  新建技能骨架(默认禁用)
18
20
  ec skill install <源> [--force] [--enable] 安装技能(目录 / .zip / .md,默认禁用)
19
21
  ec skill remove <name> 删除本机技能
@@ -23,12 +25,14 @@ const USAGE = `ec skill —— EC 技能管理
23
25
  禁用技能(默认 agent 级)
24
26
  ec skill validate <name|路径> 校验 SKILL.md 是否合规
25
27
  ec skill where 打印三级根目录路径
28
+ ec skill refresh <aid> [--json] 重建该 Agent 的技能索引(经 daemon)
26
29
 
27
30
  说明:
28
31
  - 安装目标只能是本机级(Agent 级只放开关,不放 SKILL.md)
29
32
  - create / install 装完默认**禁用**,确认后再用 enable 启用(--enable 可一步到位)
30
33
  - 内置级(随包发布)不可写、不可删
31
- - 改动后约 2 秒内标记待更新,下一条消息处理时重建索引
34
+ - 技能目录默认不再自动监控:create / install / remove / enable / disable 之后,
35
+ 执行一次 ec skill refresh <aid> 才会更新注入给模型的技能索引
32
36
  `;
33
37
 
34
38
  function parseArgs(argv) {
@@ -58,6 +62,16 @@ async function main() {
58
62
  }
59
63
 
60
64
  const sub = argv[0];
65
+
66
+ // refresh 由 daemon 执行(索引生成与鉴权都在 daemon 里),本脚本不实现 IPC 客户端:
67
+ // 原样转交包内的 ec 入口(bin/ec.js 自动选 src 或 dist),连 --help 一起交过去。
68
+ if (sub === 'refresh') {
69
+ const ecBin = path.resolve(import.meta.dirname, '..', '..', '..', '..', 'bin', 'ec.js');
70
+ const r = spawnSync(process.execPath, [ecBin, 'skill', ...argv], { stdio: 'inherit' });
71
+ if (r.error) throw r.error;
72
+ return r.status ?? 1;
73
+ }
74
+
61
75
  const { flags, positional } = parseArgs(argv.slice(1));
62
76
 
63
77
  if (flags.help) { console.log(USAGE); return 0; }