evolcore 0.0.43-test.1 → 0.0.43-test.2

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 (170) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/README.md +22 -0
  3. package/dist/agents/claude-runner.js +26 -2
  4. package/dist/agents/codex/app-server-client.js +12 -0
  5. package/dist/agents/codex-runner.js +49 -8
  6. package/dist/agents/ecagent-runner.js +26 -9
  7. package/dist/agents/gemini-runner.js +15 -12
  8. package/dist/agents/tool-time-context.js +55 -0
  9. package/dist/aun/menu/client.js +1 -1
  10. package/dist/aun/model-headers.js +17 -0
  11. package/dist/aun/msg/p2p.js +3 -0
  12. package/dist/channels/aun.js +484 -43
  13. package/dist/channels/builtin-plugins.js +16 -11
  14. package/dist/channels/dingtalk.js +83 -31
  15. package/dist/channels/feishu.js +29 -13
  16. package/dist/channels/qqbot.js +32 -11
  17. package/dist/channels/wechat.js +13 -3
  18. package/dist/channels/wecom.js +67 -27
  19. package/dist/cli/agent-command.js +3 -86
  20. package/dist/cli/agent-create.js +22 -6
  21. package/dist/cli/agent.js +1 -79
  22. package/dist/cli/aun-commands.js +1 -0
  23. package/dist/cli/config.js +1 -1
  24. package/dist/cli/daemon-commands.js +47 -2
  25. package/dist/cli/data-command.js +9 -1
  26. package/dist/cli/debug-mode.js +1 -1
  27. package/dist/cli/diag.js +1 -1
  28. package/dist/cli/directory.js +77 -64
  29. package/dist/cli/getmeta-command.js +1 -1
  30. package/dist/cli/index.js +79 -22
  31. package/dist/cli/init.js +1 -23
  32. package/dist/cli/link-rules.js +1 -1
  33. package/dist/cli/managed-command-guard.js +0 -1
  34. package/dist/cli/pa-workspace-command.js +36 -2
  35. package/dist/cli/peer.js +1 -1
  36. package/dist/cli/restart-monitor.js +17 -3
  37. package/dist/cli/role.js +1 -1
  38. package/dist/cli/session-command.js +1 -1
  39. package/dist/cli/stats.js +2 -2
  40. package/dist/cli/thread-command.js +1 -1
  41. package/dist/cli/watch-msg.js +1 -1
  42. package/dist/config/access-policy.js +1 -0
  43. package/dist/config/config-field-policy.js +2 -2
  44. package/dist/config/config-manager.js +7 -0
  45. package/dist/config/role-schema.js +4 -3
  46. package/dist/config/role-service.js +3 -3
  47. package/dist/config-store.js +75 -4
  48. package/dist/core/agent-ipc-registration.js +16 -59
  49. package/dist/core/auth/authorization-audit.js +52 -14
  50. package/dist/core/auth/operation-authorizer.js +0 -11
  51. package/dist/core/auth/operation-catalog.js +0 -18
  52. package/dist/core/channel-loader.js +152 -16
  53. package/dist/core/command/agent-control.js +2 -1
  54. package/dist/core/command/cli-intent-parser.js +0 -8
  55. package/dist/core/command/command-handler.js +17 -46
  56. package/dist/core/command/connect-menu.js +7 -3
  57. package/dist/core/command/menu-catalog.js +3 -2
  58. package/dist/core/command/menu-handler.js +51 -8
  59. package/dist/core/command/menu-protocol.js +20 -0
  60. package/dist/core/command/slash-handler.js +101 -40
  61. package/dist/core/daemon-file-cache.js +3 -3
  62. package/dist/core/evolagent-registry.js +5 -4
  63. package/dist/core/evolagent.js +5 -8
  64. package/dist/core/handoff/argv-parse.js +115 -0
  65. package/dist/core/handoff/ipc-registration.js +1 -1
  66. package/dist/core/ipc-registration.js +19 -2
  67. package/dist/core/memory/consolidation.js +8 -1
  68. package/dist/core/memory/relation-sweep.js +20 -8
  69. package/dist/core/message/aun-ipc-sender.js +28 -1
  70. package/dist/core/message/contact-admission.js +548 -0
  71. package/dist/core/message/im-renderer.js +69 -10
  72. package/dist/core/message/message-admission.js +28 -3
  73. package/dist/core/message/message-bridge.js +46 -5
  74. package/dist/core/message/message-utils.js +0 -5
  75. package/dist/core/message/peer-mode.js +44 -10
  76. package/dist/core/message/response-engine.js +268 -69
  77. package/dist/core/message/retry-scheduler.js +4 -0
  78. package/dist/core/permission/ec-command-parser.js +1 -28
  79. package/dist/core/permission/readonly-shell-query.js +34 -8
  80. package/dist/core/permission/tool-policy.js +50 -5
  81. package/dist/core/role/runtime-policy.js +14 -2
  82. package/dist/core/session/session-manager.js +9 -1
  83. package/dist/core/soul.js +66 -0
  84. package/dist/core/system-session/memory.js +2 -2
  85. package/dist/directory/contact-admission-paths.js +9 -0
  86. package/dist/directory/owner-directory-admission.js +128 -29
  87. package/dist/directory/owner-directory-cache.js +364 -50
  88. package/dist/directory/owner-directory-identity.js +60 -0
  89. package/dist/directory/owner-directory-markdown.js +120 -47
  90. package/dist/directory/owner-directory-policy.js +108 -0
  91. package/dist/directory/owner-directory-query-operation.js +219 -32
  92. package/dist/directory/owner-directory-remarks.js +29 -2
  93. package/dist/directory/owner-directory-search.js +50 -18
  94. package/dist/directory/owner-directory-store.js +150 -30
  95. package/dist/eck/kit-renderer.js +12 -5
  96. package/dist/eck/manifest-engine.js +55 -6
  97. package/dist/eck/message-renderer.js +5 -2
  98. package/dist/eck/paactive-context.js +45 -0
  99. package/dist/ecweb/basic-settings-service.js +2 -2
  100. package/dist/ecweb/message-context-service.js +24 -16
  101. package/dist/index.js +9 -5
  102. package/dist/ipc.js +1 -1
  103. package/dist/paths.js +26 -0
  104. package/dist/response-system/config-resolver.js +1 -1
  105. package/dist/response-system/engines/v1/index.js +4 -1
  106. package/dist/response-system/engines/v1/paactive-flow.js +18 -0
  107. package/dist/response-system/modes/single-session/index.js +7 -2
  108. package/dist/trigger/scheduler.js +3 -5
  109. package/dist/trigger/validation.js +4 -0
  110. package/dist/utils/error-utils.js +5 -2
  111. package/dist/utils/logger.js +13 -4
  112. package/dist/utils/npm-ops.js +2 -2
  113. package/dist/utils/windows-autostart.js +1 -1
  114. package/ecagent/dist/agent-loop.js +43 -1
  115. package/kits/docs/INDEX.md +1 -0
  116. package/kits/docs/context-assembly.md +21 -6
  117. package/kits/docs/eck_templates/INDEX.template.md +1 -2
  118. package/kits/docs/evolcore/INDEX.md +1 -1
  119. package/kits/docs/evolcore/agent-create.md +5 -5
  120. package/kits/docs/evolcore/agent.md +4 -9
  121. package/kits/docs/evolcore/directory.md +137 -0
  122. package/kits/docs/evolcore/menu-protocol.md +55 -0
  123. package/kits/docs/evolcore/response.md +7 -1
  124. package/kits/docs/evolcore/tool-authorization.md +1 -1
  125. package/kits/docs/evolcore/trigger.md +4 -0
  126. package/kits/docs/prompt-loading-architecture.md +6 -2
  127. package/kits/eck_manifest.auxiliary.json +1 -0
  128. package/kits/eck_manifest.json +57 -4
  129. package/kits/eck_manifest.memory.json +67 -3
  130. package/kits/eck_manifest.paactive.json +528 -0
  131. package/kits/eck_message_manifest.paactive.json +233 -0
  132. package/kits/rules/01-overview.md +2 -2
  133. package/kits/rules/03-identity.md +10 -9
  134. package/kits/rules/05-venue.md +2 -4
  135. package/kits/rules/06-channel.md +1 -1
  136. package/kits/schemas/_meta.json +31 -3
  137. package/kits/schemas/agent-config.schema.18.json +5 -0
  138. package/kits/schemas/agent-config.schema.19.json +924 -0
  139. package/kits/schemas/relation-config.schema.12.json +289 -0
  140. package/kits/schemas/role-config.schema.2.json +215 -0
  141. package/kits/skills/ec-skill/scripts/cli.mjs +3 -2
  142. package/kits/skills/ec-trigger/SKILL.md +4 -4
  143. package/kits/skills/personal-assistant/SKILL.md +109 -53
  144. package/kits/skills/personal-assistant/references/02-bootstrap.md +73 -30
  145. package/kits/skills/personal-assistant/scripts/clean.mjs +35 -18
  146. package/kits/skills/personal-assistant/scripts/init.mjs +41 -2
  147. package/kits/skills/personal-assistant/scripts/lib/persona.mjs +185 -0
  148. package/kits/skills/personal-assistant/scripts/migrate.mjs +55 -4
  149. package/kits/skills/personal-assistant/scripts/pa.mjs +173 -0
  150. package/kits/skills/personal-assistant/scripts/uninstall.mjs +130 -0
  151. package/kits/skills/personal-assistant/templates/persona-section.md +3 -3
  152. package/kits/templates/message-fragments/handoff-request-to-target.md +1 -1
  153. package/kits/templates/message-fragments/paactive/item.md +3 -0
  154. package/kits/templates/soul/00-GUIDE.md +61 -0
  155. package/kits/templates/soul/01-identity.md +5 -0
  156. package/kits/templates/soul/02-persona.md +11 -0
  157. package/kits/templates/soul/03-duties.md +5 -0
  158. package/kits/templates/soul/04-working-style.md +5 -0
  159. package/kits/templates/system-fragments/bootstrap.md +7 -7
  160. package/kits/templates/system-fragments/commands.md +3 -2
  161. package/kits/templates/system-fragments/directory-contacts.md +9 -0
  162. package/kits/templates/system-fragments/memory.md +1 -1
  163. package/kits/templates/system-fragments/paactive/channel.md +25 -0
  164. package/kits/templates/system-fragments/paactive/reply.md +25 -0
  165. package/kits/templates/system-fragments/paactive/session.md +32 -0
  166. package/kits/templates/system-fragments/personal-assistant.md +65 -0
  167. package/package.json +3 -2
  168. package/dist/cli/handoff-command.js +0 -353
  169. package/dist/directory/owner-directory-remark-operation.js +0 -147
  170. package/kits/docs/evolcore/self-summary.md +0 -29
@@ -0,0 +1,289 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "relation-config.schema.12.json",
4
+ "title": "RelationConfig v12 (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
+ {
12
+ "required": [
13
+ "permissionMode"
14
+ ]
15
+ },
16
+ {
17
+ "required": [
18
+ "roles"
19
+ ]
20
+ },
21
+ {
22
+ "required": [
23
+ "aun"
24
+ ],
25
+ "properties": {
26
+ "aun": {
27
+ "type": "object",
28
+ "required": [
29
+ "defaultEncrypt"
30
+ ]
31
+ }
32
+ }
33
+ }
34
+ ]
35
+ },
36
+ "properties": {
37
+ "$schema_version": {
38
+ "type": "number",
39
+ "const": 12,
40
+ "default": 12,
41
+ "x-merge": "scalar"
42
+ },
43
+ "targetKind": {
44
+ "type": "string",
45
+ "enum": [
46
+ "private",
47
+ "group"
48
+ ],
49
+ "x-merge": "scalar"
50
+ },
51
+ "role": {
52
+ "type": [
53
+ "string",
54
+ "null"
55
+ ],
56
+ "pattern": "^(?!owner$)[a-z0-9_-]+$",
57
+ "x-merge": "scalar",
58
+ "description": "关系角色;允许 admin/member/visitor/自定义角色,禁止 owner"
59
+ },
60
+ "chatmode": {
61
+ "type": "object",
62
+ "x-merge": "dict",
63
+ "properties": {
64
+ "private": {
65
+ "enum": [
66
+ "interactive",
67
+ "proactive",
68
+ "paactive"
69
+ ]
70
+ },
71
+ "group": {
72
+ "enum": [
73
+ "interactive",
74
+ "proactive"
75
+ ]
76
+ },
77
+ "nothuman": {
78
+ "enum": [
79
+ "interactive",
80
+ "proactive"
81
+ ]
82
+ }
83
+ },
84
+ "additionalProperties": false
85
+ },
86
+ "mentionMode": {
87
+ "type": "string",
88
+ "enum": [
89
+ "disabled",
90
+ "mention-only",
91
+ "auto"
92
+ ],
93
+ "x-merge": "scalar"
94
+ },
95
+ "autoMentionQuietWindowMs": {
96
+ "type": "number",
97
+ "minimum": 0,
98
+ "default": 3000,
99
+ "x-merge": "scalar",
100
+ "description": "群聊 auto 注意力分类的静默等待窗口,单位为毫秒;默认 3000"
101
+ },
102
+ "sessionLoop": {
103
+ "type": "object",
104
+ "x-merge": "scalar",
105
+ "description": "当前关系主会话的闲置触发设置;话题不继承",
106
+ "oneOf": [
107
+ {
108
+ "properties": {
109
+ "enabled": {
110
+ "const": false
111
+ }
112
+ },
113
+ "required": [
114
+ "enabled"
115
+ ],
116
+ "additionalProperties": false
117
+ },
118
+ {
119
+ "properties": {
120
+ "enabled": {
121
+ "const": true
122
+ },
123
+ "idleSeconds": {
124
+ "type": "integer",
125
+ "minimum": 30,
126
+ "maximum": 86400
127
+ }
128
+ },
129
+ "required": [
130
+ "enabled",
131
+ "idleSeconds"
132
+ ],
133
+ "additionalProperties": false
134
+ }
135
+ ]
136
+ },
137
+ "sessionFullAccess": {
138
+ "type": "object",
139
+ "x-merge": "scalar",
140
+ "description": "当前关系主会话的 /fa 开关,跨 EC session 保留;话题不继承,仅由 /fa 和 session Menu 管理",
141
+ "properties": {
142
+ "enabled": {
143
+ "type": "boolean"
144
+ },
145
+ "authorizedBy": {
146
+ "type": "string",
147
+ "minLength": 1
148
+ },
149
+ "promptedSessionId": {
150
+ "type": "string",
151
+ "minLength": 1,
152
+ "description": "本次局部开启后已收到 fullaccess 提示的 EC session"
153
+ }
154
+ },
155
+ "required": [
156
+ "enabled",
157
+ "authorizedBy"
158
+ ],
159
+ "additionalProperties": false
160
+ },
161
+ "responseMode": {
162
+ "type": "string",
163
+ "x-merge": "scalar"
164
+ },
165
+ "responseModeParams": {
166
+ "type": "object",
167
+ "x-merge": "dict"
168
+ },
169
+ "baseagents": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "description": "关系级仅可配置 runner 行为参数;model 与 effort 仅支持 Agent 级。",
173
+ "patternProperties": {
174
+ "^[a-z][a-z0-9_-]*$": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "agentProgressSummaries": {
179
+ "type": "boolean"
180
+ },
181
+ "excludeDynamicSections": {
182
+ "type": "boolean"
183
+ },
184
+ "enableRequestUserInput": {
185
+ "type": "boolean"
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "x-merge": "dict"
191
+ },
192
+ "flush_delay": {
193
+ "type": "number",
194
+ "x-merge": "scalar"
195
+ },
196
+ "debounce": {
197
+ "type": "number",
198
+ "x-merge": "scalar"
199
+ },
200
+ "show_activities": {
201
+ "type": "string",
202
+ "enum": [
203
+ "all",
204
+ "text",
205
+ "none"
206
+ ],
207
+ "x-merge": "scalar"
208
+ },
209
+ "enable_rich_content": {
210
+ "type": "boolean",
211
+ "x-merge": "scalar"
212
+ },
213
+ "session_renew": {
214
+ "type": "object",
215
+ "x-merge": "dict",
216
+ "additionalProperties": false,
217
+ "properties": {
218
+ "enabled": {
219
+ "type": "boolean"
220
+ },
221
+ "after_hours": {
222
+ "type": "number",
223
+ "exclusiveMinimum": 0
224
+ },
225
+ "fallback_action": {
226
+ "type": "string",
227
+ "enum": [
228
+ "continue",
229
+ "new"
230
+ ]
231
+ },
232
+ "new_probability_threshold": {
233
+ "type": "number",
234
+ "minimum": 0,
235
+ "maximum": 1
236
+ }
237
+ }
238
+ },
239
+ "memory": {
240
+ "type": "object",
241
+ "x-merge": "dict",
242
+ "additionalProperties": false,
243
+ "description": "关系级记忆开关;enableRelation 由对端自主配置,与 agent 级 memory.enableRelation 做 AND 合并(任意层为 false 则关闭)。",
244
+ "properties": {
245
+ "enableRelation": {
246
+ "type": "boolean",
247
+ "x-merge-logic": "AND",
248
+ "description": "对端自主控制本关系的 relation 作用域记忆是否启用;与 agent 级 enableRelation 做 AND 合并。"
249
+ }
250
+ }
251
+ },
252
+ "group_venue_sync": {
253
+ "type": "object",
254
+ "x-merge": "dict"
255
+ },
256
+ "groupRules": {
257
+ "type": "object",
258
+ "x-merge": "dict",
259
+ "additionalProperties": false,
260
+ "properties": {
261
+ "mode": {
262
+ "type": "string",
263
+ "enum": [
264
+ "load",
265
+ "ignore"
266
+ ],
267
+ "default": "load",
268
+ "description": "是否读取并注入当前 AUN 群已发布的 /rules.md;默认 load。"
269
+ }
270
+ }
271
+ },
272
+ "render": {
273
+ "type": "object",
274
+ "x-merge": "dict"
275
+ },
276
+ "sessionManifests": {
277
+ "type": "object",
278
+ "x-merge": "dict"
279
+ },
280
+ "extra_backup": {
281
+ "type": "array",
282
+ "items": {
283
+ "type": "object"
284
+ },
285
+ "x-merge": "list"
286
+ }
287
+ },
288
+ "description": "关系级配置。模型参数(模型、服务商、推理强度、降级链)只在 Agent 级 config.json 配置。"
289
+ }
@@ -0,0 +1,215 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "role-config.schema.2.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" }, { "value": "paactive", "label": "PA Activity" }] },
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" }, { "value": "auto", "label": "Auto" }] },
13
+ { "value": "baseagents.claude.model", "label": "Claude Model", "description": "角色对 Agent 级 Claude 模型的约束(固定模型 / 模型白名单);模型只在 Agent 级配置,角色不提供模型。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": false, "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": false, "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": "角色对 Agent 级 Codex 模型的约束(固定模型 / 模型白名单);模型只在 Agent 级配置,角色不提供模型。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": false, "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": false, "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
+ { "value": "baseagents.ecagent.model", "label": "EC Agent Model", "description": "角色对 Agent 级 ecagent 模型的约束(固定模型 / 模型白名单);模型只在 Agent 级配置,角色不提供模型。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": false, "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": false, "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
+ { "value": "baseagents.gemini.model", "label": "Gemini Model", "description": "角色对 Agent 级 Gemini 模型的约束(固定模型 / 模型白名单);模型只在 Agent 级配置,角色不提供模型。", "valueType": "model", "hasOptions": true, "relationOverrideApplied": false, "constraintsApplied": true, "editable": true, "x-runtimeApplied": true, "x-optionsSource": "model-catalog", "patterns": [{ "value": "*", "label": "All Gemini models" }, { "value": "gemini-*", "label": "Gemini model family" }] }
20
+ ],
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["$schema_version", "description", "permissions"],
24
+ "properties": {
25
+ "$schema_version": { "type": "number", "const": 2, "default": 2, "description": "角色配置 Schema 版本;v2 新增私聊 paactive 模式。" },
26
+ "description": { "type": "string", "description": "角色的用途、信任级别和授权边界说明。" },
27
+ "rank": { "type": "integer", "enum": [100, 300, 500, 700, 900], "description": "角色排序系数;内置角色固定,自定义角色固定为 500。旧文件缺省时由角色加载器补齐。" },
28
+ "allowAccess": { "type": "boolean", "default": true, "description": "是否允许该角色访问 Agent;缺省为 true。" },
29
+ "permissions": {
30
+ "type": "object",
31
+ "required": ["permissionMode"],
32
+ "description": "角色对运行时行为字段施加的默认值、关系级覆盖权及候选值约束。",
33
+ "properties": {
34
+ "permissionMode": {
35
+ "type": "object",
36
+ "required": ["default", "allowOverride"],
37
+ "additionalProperties": false,
38
+ "description": "工具调用审批模式策略;该策略必须存在且不允许关系级覆盖。",
39
+ "properties": {
40
+ "default": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "该角色实际使用的工具调用审批模式。", "x-enumDescriptions": { "readonly": "只读模式:明确只读工具和普通路径上的受限只读 Shell 自动执行;写入、H/L 类读取、未知 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权", "auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝", "request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批", "bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批" } },
41
+ "allowOverride": { "const": false, "default": false, "description": "权限模式禁止关系级覆盖,固定为 false。" },
42
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "一个可列入权限模式候选集合的值。", "x-enumDescriptions": { "readonly": "只读模式", "auto": "自动模式", "request": "请求人工审批模式", "bypass": "受强制危险规则约束的放行模式" } }, "uniqueItems": true, "description": "保留的权限模式候选集合;permissionMode 当前不可由关系级覆盖,通常无需配置。" },
43
+ "reason": { "type": "string", "description": "采用该权限模式策略的可审计原因或管理备注。" }
44
+ }
45
+ },
46
+ "chatmode.private": {
47
+ "type": "object",
48
+ "required": ["default", "allowOverride"],
49
+ "additionalProperties": false,
50
+ "description": "该角色在私聊场景中的响应方式策略。",
51
+ "properties": {
52
+ "default": { "type": "string", "enum": ["interactive", "proactive", "paactive"], "description": "未设置有效关系级覆盖时使用的私聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影", "paactive": "PA 模式:模型文本作为 activity,正式回复使用 CLI" } },
53
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖私聊响应方式;缺省为 false。" },
54
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive", "paactive"], "description": "一个可用于私聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影", "paactive": "PA 模式:模型文本作为 activity,正式回复使用 CLI" } }, "uniqueItems": true, "description": "允许关系级覆盖到的私聊响应方式白名单;若提供,必须包含 default。" },
55
+ "reason": { "type": "string", "description": "采用该私聊响应策略的可审计原因或管理备注。" }
56
+ }
57
+ },
58
+ "chatmode.group": {
59
+ "type": "object",
60
+ "required": ["default", "allowOverride"],
61
+ "additionalProperties": false,
62
+ "description": "该角色在群聊场景中的响应方式策略。",
63
+ "properties": {
64
+ "default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的群聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
65
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊响应方式;缺省为 false。" },
66
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["interactive", "proactive"], "description": "一个可用于群聊响应方式覆盖的值。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊响应方式白名单;若提供,必须包含 default。" },
67
+ "reason": { "type": "string", "description": "采用该群聊响应策略的可审计原因或管理备注。" }
68
+ }
69
+ },
70
+ "mentionMode": {
71
+ "type": "object",
72
+ "required": ["default", "allowOverride"],
73
+ "additionalProperties": false,
74
+ "description": "该角色在群聊场景中的提及响应策略。",
75
+ "properties": {
76
+ "default": { "type": "string", "enum": ["disabled", "mention-only", "auto"], "description": "未设置有效关系级覆盖时使用的群聊提及响应策略。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应", "auto": "按群内上下文自动判断" } },
77
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊提及响应策略;缺省为 false。" },
78
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["disabled", "mention-only", "auto"], "description": "一个可用于群聊提及响应策略覆盖的值。", "x-enumDescriptions": { "disabled": "不要求被提及即可响应", "mention-only": "仅在被明确提及时响应", "auto": "按群内上下文自动判断" } }, "uniqueItems": true, "description": "允许关系级覆盖到的群聊提及响应策略白名单;若提供,必须包含 default。" },
79
+ "reason": { "type": "string", "description": "采用该群聊提及响应策略的可审计原因或管理备注。" }
80
+ }
81
+ },
82
+ "baseagents.claude.effort": {
83
+ "type": "object",
84
+ "required": ["default", "allowOverride"],
85
+ "additionalProperties": false,
86
+ "description": "该角色使用 Claude runner 时的推理强度策略。",
87
+ "properties": {
88
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 Claude 推理强度。", "x-enumDescriptions": { "auto": "由 Claude runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
89
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Claude 推理强度;缺省为 false。" },
90
+ "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。" },
91
+ "reason": { "type": "string", "description": "采用该 Claude 推理强度策略的可审计原因或管理备注。" }
92
+ }
93
+ },
94
+ "baseagents.codex.effort": {
95
+ "type": "object",
96
+ "required": ["default", "allowOverride"],
97
+ "additionalProperties": false,
98
+ "description": "该角色使用 Codex runner 时的推理强度策略。",
99
+ "properties": {
100
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 Codex 推理强度。", "x-enumDescriptions": { "auto": "由 Codex runner 自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
101
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 Codex 推理强度;缺省为 false。" },
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
+ "reason": { "type": "string", "description": "采用该 Codex 推理强度策略的可审计原因或管理备注。" }
104
+ }
105
+ },
106
+ "baseagents.ecagent.effort": {
107
+ "type": "object",
108
+ "required": ["default", "allowOverride"],
109
+ "additionalProperties": false,
110
+ "description": "该角色使用 ecagent runner 时的推理强度策略。",
111
+ "properties": {
112
+ "default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 ecagent 推理强度。" },
113
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖 ecagent 推理强度;缺省为 false。" },
114
+ "allowedValues": { "type": "array", "items": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"] }, "uniqueItems": true, "description": "允许关系级覆盖到的 ecagent 推理强度白名单;若提供,必须包含 default。" },
115
+ "reason": { "type": "string", "description": "采用该 ecagent 推理强度策略的可审计原因或管理备注。" }
116
+ }
117
+ }
118
+ },
119
+ "patternProperties": {
120
+ "^baseagents\\.[a-z0-9_-]+\\.model$": {
121
+ "type": "object",
122
+ "required": ["default", "allowOverride", "allowedModels"],
123
+ "additionalProperties": false,
124
+ "description": "指定 base agent 的角色模型策略;默认模型必须匹配 allowedModels。",
125
+ "properties": {
126
+ "default": { "type": "string", "minLength": 1, "description": "该角色默认使用的模型标识;必须被 allowedModels 中的精确值或通配符允许。" },
127
+ "allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖模型;缺省为 false。" },
128
+ "allowedModels": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "description": "一个允许使用的模型标识或以 * 表达的通配符模式。" }, "uniqueItems": true, "description": "该角色可用的模型白名单;支持通配符,且至少包含一个条目。" },
129
+ "reason": { "type": "string", "description": "采用该角色模型策略的可审计原因或管理备注。" }
130
+ }
131
+ }
132
+ },
133
+ "additionalProperties": false
134
+ },
135
+ "commandPermissions": {
136
+ "type": "object",
137
+ "x-optionsSource": "operation-catalog",
138
+ "description": "按 operation 标识定义角色的命令执行权限;候选 operation 来自运行时 operation catalog。",
139
+ "propertyNames": { "type": "string", "minLength": 1, "description": "非空 operation 标识,支持精确名称及系统识别的通配规则。" },
140
+ "additionalProperties": {
141
+ "type": "object",
142
+ "required": ["allow"],
143
+ "additionalProperties": false,
144
+ "description": "一个 operation 的角色授权规则。",
145
+ "properties": {
146
+ "allow": { "type": "boolean", "description": "是否允许该角色执行匹配的 operation。" },
147
+ "dangerous": { "type": "boolean", "default": false, "description": "是否将该授权规则标记为危险操作规则;危险操作还会应用额外安全约束。" },
148
+ "permissionMode": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "临时 operation 级权限模式;后续迁移到作用域模式规则。" },
149
+ "scopes": {
150
+ "type": "array",
151
+ "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 执行域" } },
152
+ "uniqueItems": true,
153
+ "description": "该授权规则允许生效的作用域白名单;未配置时由 operation 自身和鉴权器决定。"
154
+ },
155
+ "constraints": {
156
+ "type": "object",
157
+ "additionalProperties": false,
158
+ "description": "operation 级附加约束,例如对端、Agent、群聊、控制通道、参数或工作目录限制。",
159
+ "properties": {
160
+ "ownPeerOnly": { "type": "boolean" },
161
+ "ownAgentOnly": { "type": "boolean" },
162
+ "targetCurrentAgentOnly": { "type": "boolean" },
163
+ "requireAgentAdmin": { "type": "boolean" },
164
+ "requireAgentOwner": { "type": "boolean" },
165
+ "privateOnly": { "type": "boolean" },
166
+ "groupOnly": { "type": "boolean" },
167
+ "requireDaemonOwner": { "type": "boolean" },
168
+ "requireControlChannel": { "type": "boolean" },
169
+ "requireExplicitDangerousGrant": { "type": "boolean" },
170
+ "currentRelationOnly": { "type": "boolean" },
171
+ "requireFieldOverride": { "type": "string", "minLength": 1 },
172
+ "configFieldPolicy": { "type": "string", "enum": ["behavior-read", "role-overridable-write"] },
173
+ "allowedArgs": { "$ref": "#/definitions/argumentConstraints" },
174
+ "deniedArgs": { "$ref": "#/definitions/argumentConstraints" },
175
+ "forbiddenFlags": { "$ref": "#/definitions/stringList" },
176
+ "allowedConfigKeys": { "$ref": "#/definitions/stringList" },
177
+ "allowedPrefixes": { "$ref": "#/definitions/stringList" },
178
+ "timeoutMs": { "type": "integer", "minimum": 0 },
179
+ "outputLimitBytes": { "type": "integer", "minimum": 0 },
180
+ "cwdPolicy": { "type": "string", "enum": ["agentProject", "evolcoreHome", "none"] },
181
+ "envAllowlist": { "$ref": "#/definitions/stringList" }
182
+ }
183
+ },
184
+ "reason": { "type": "string", "description": "采用该命令权限规则的可审计原因或管理备注。" }
185
+ }
186
+ }
187
+ },
188
+ "usageLimits": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "description": "角色用量额度策略;enabled 未开启或未配置时不启用额度限制。",
192
+ "properties": {
193
+ "enabled": { "type": "boolean", "default": false, "description": "是否启用该角色的用量额度限制;缺省为 false。" },
194
+ "resetMode": { "type": "string", "enum": ["never", "daily", "weekly", "monthly"], "description": "用量额度的重置周期。", "x-enumDescriptions": { "never": "累计额度,从不自动重置", "daily": "每日重置", "weekly": "每周重置", "monthly": "每月重置" } },
195
+ "currency": { "type": "string", "enum": ["CNY", "USD"], "description": "额度金额使用的计价货币。", "x-enumDescriptions": { "CNY": "人民币", "USD": "美元" } },
196
+ "limitAmount": { "type": ["number", "null"], "minimum": 0, "description": "额度上限金额;非负数表示上限,null 表示不限。" },
197
+ "costBasis": { "type": "string", "enum": ["gateway", "official"], "description": "额度统计采用的模型计费口径。", "x-enumDescriptions": { "gateway": "按实际网关计费价统计", "official": "按模型提供商官方定价统计" } },
198
+ "scope": { "type": "string", "enum": ["subject", "role"], "description": "额度累计和重置的统计范围。", "x-enumDescriptions": { "subject": "按对端主体分别统计", "role": "同一角色的所有主体共享统计" } }
199
+ }
200
+ }
201
+ },
202
+ "definitions": {
203
+ "stringList": {
204
+ "type": "array",
205
+ "items": { "type": "string" }
206
+ },
207
+ "argumentConstraints": {
208
+ "type": "object",
209
+ "additionalProperties": {
210
+ "type": "array",
211
+ "items": { "type": ["string", "number", "boolean"] }
212
+ }
213
+ }
214
+ }
215
+ }
@@ -10,9 +10,10 @@ import * as S from './skill.mjs';
10
10
  import path from 'node:path';
11
11
  import { spawnSync } from 'node:child_process';
12
12
 
13
- const USAGE = `ec skill —— EC 技能管理
13
+ const USAGE = `用法: ec skill <command> [options]
14
+
15
+ ec skill —— EC 技能管理
14
16
 
15
- 用法:
16
17
  ec skill load <name> [--source builtin|local] [--with-frontmatter]
17
18
  加载技能正文(输出 SKILL.md 内容 + skillDir)
18
19
  ec skill path <name> [--json] 查看技能 SKILL.md 完整路径(含状态和时间戳)
@@ -72,8 +72,8 @@ ec trigger create --cron '0 9 * * *' --tz Asia/Shanghai \
72
72
  1. **边界**:短期跟进的周期 trigger 加 `--max-runs` 或 `--max-duration`。到上限自动 `disable`
73
73
  (定义留着、可查),不会删。无限周期的巡检只留给用户明确要求"一直跑"的场景。
74
74
  2. **NOOP**:周期任务有"没事可报"的情况,提示词里写死"无异常时**只输出** `[[NOOP]]`"。
75
- **整段输出必须恰好是 `[[NOOP]]`**(前后不能有其它文字,结尾换行没关系),否则结果照样
76
- 投递,模型还会额外对着用户说一圈废话。
75
+ 成功回复忽略开头空白后,以 `[[NOOP]]` 开头就静默;后面可以附原因,仅留在内部执行记录。
76
+ 正文中间引用标记不会静默,执行失败仍报告错误。流式拆分的标记也在投递前识别。
77
77
  3. **复核**:建完立刻 `ec trigger show <id> --json` 看三样:`enabled`、`feedback.target`、
78
78
  `schedule.nextFireAt`(cron 看得到下次触发时刻;与预期不符就是时区/表达式问题)。
79
79
  改定义一律带 `--if-revision <show 返回的 revision>`,改完再看 revision 变了没有。
@@ -92,7 +92,7 @@ ec trigger create --cron '0 9 * * *' --tz Asia/Shanghai \
92
92
  用户没收到。排查时看 `history` 里的 `effects`。
93
93
  - **你被 trigger 唤醒时**:信封里的 `触发于:` 是排定时刻(firedAt),不是唤醒时刻;
94
94
  proactive 模式下正文流式输出会被丢弃,**回复必须走 `ec ctl send`**;`[[NOOP]]` 仍适用,
95
- 只用它、别在它前后多说一句。
95
+ 应放在正文开头(允许前导空白);附带原因只保留在内部记录。显式发送的消息无法撤回。
96
96
  - **提示词里能用的变量**:`{{trigger.name}}`、`{{run.number}}`(第几次)、`{{run.elapsed}}`、
97
97
  `{{date}}`、`{{time}}`,事件触发另有 `{{event.<字段>}}`。提示词正文走同一套渲染。
98
98
  - **每次创建都是新 trigger**:重复建同一个提醒会得到多个 trigger,各自都会触发。先 `list` 查。
@@ -154,7 +154,7 @@ ec trigger create --event 'task:error' \
154
154
  | 根本没触发 | `show --json` 的 `nextFireAt`、`recentRuns`;`list --all` | 被 disable、cron 表达式/时区错、一次性已跑完、上限已命中 |
155
155
  | 触发了但没送到 | `history` 的 `effects` / `feedback` | target 路由写错、AUN 缺 chatType、渠道未配置 |
156
156
  | 发到了错的会话 | `show --json` 的 `feedback.target` / `origin` | 在话题里建但用了 target、目标会话不存在被新建 |
157
- | 用户收到一堆废话 | run 状态 `completed` 但内容很啰嗦 | `[[NOOP]]` 没独占整段输出 |
157
+ | 用户收到一堆废话 | run 状态 `completed` 但内容很啰嗦 | `[[NOOP]]` 没放在正文开头,或已显式发送消息 |
158
158
  | 每次跑很久/堆任务 | `show --json` 的 `active`;`history` | 周期比执行时间短,queue 串行排队;concurrency 设为 forbid |
159
159
  | 脚本报沙箱不可用 | 脚本路径/项目路径 | 受保护路径,或宿主未准备沙箱 |
160
160
  | 手动跑有效、定时没效 | `history` 时间线 | 错过策略、daemon 停机、时区 |