evolcore 0.0.43-test.4 → 0.0.43-test.5

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 (129) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/bin/ecmsg.js +354 -91
  3. package/dist/agents/codex-runner.js +12 -17
  4. package/dist/aun/aid/agentmd.js +25 -0
  5. package/dist/aun/aid/control-aid.js +15 -0
  6. package/dist/aun/aid/identity.js +8 -0
  7. package/dist/aun/aid/ownership-operation.js +12 -3
  8. package/dist/channels/aun.js +30 -17
  9. package/dist/channels/daemon.js +2 -2
  10. package/dist/cli/agent-create.js +4 -2
  11. package/dist/cli/aid-bind-command.js +3 -0
  12. package/dist/cli/aun-commands.js +10 -3
  13. package/dist/cli/code-stats.js +451 -213
  14. package/dist/cli/ctl-command.js +1 -3
  15. package/dist/cli/daemon-commands.js +12 -3
  16. package/dist/cli/directory.js +3 -1
  17. package/dist/cli/ecmsg-gateway.js +204 -0
  18. package/dist/cli/index.js +6 -0
  19. package/dist/cli/init.js +45 -13
  20. package/dist/cli/provider-command.js +82 -5
  21. package/dist/cli/restart-monitor.js +11 -19
  22. package/dist/cli/stats.js +8 -1
  23. package/dist/cli/task-context.js +3 -0
  24. package/dist/config/boot-log.js +12 -1
  25. package/dist/config/config-manager.js +4 -13
  26. package/dist/config/daemon-services.js +1 -0
  27. package/dist/config/peer-role-resolver.js +5 -5
  28. package/dist/config/provider-identity-migration.js +202 -0
  29. package/dist/config/provider-identity.js +37 -0
  30. package/dist/config/provider-ipc-service.js +40 -3
  31. package/dist/config/provider-local-sync.js +153 -0
  32. package/dist/config/providers-config.js +32 -4
  33. package/dist/config/providers-management.js +144 -68
  34. package/dist/config/providers.js +4 -1
  35. package/dist/config/schema-migration.js +67 -3
  36. package/dist/core/agent-runtime.js +4 -2
  37. package/dist/core/auth/auth-gateway.js +5 -3
  38. package/dist/core/auth/delegation-diagnostics.js +6 -2
  39. package/dist/core/auth/operation-authorizer.js +3 -1
  40. package/dist/core/auth/operation-catalog.js +6 -4
  41. package/dist/core/command/cli-intent-parser.js +2 -1
  42. package/dist/core/command/command-handler.js +11 -6
  43. package/dist/core/command/menu-protocol.js +4 -2
  44. package/dist/core/command/provider-menu.js +4 -2
  45. package/dist/core/command/role-menu.js +2 -2
  46. package/dist/core/command/slash-handler.js +52 -16
  47. package/dist/core/handoff/runtime.js +9 -3
  48. package/dist/core/initialization/service.js +4 -3
  49. package/dist/core/message/aun-ipc-sender.js +81 -3
  50. package/dist/core/message/message-admission.js +2 -0
  51. package/dist/core/message/response-engine.js +23 -23
  52. package/dist/core/message/send-options.js +40 -0
  53. package/dist/core/message/send-routing.js +310 -0
  54. package/dist/core/ownership/owner-resolver.js +111 -8
  55. package/dist/core/permission/ec-command-parser.js +148 -15
  56. package/dist/core/permission/readonly-shell-query.js +66 -7
  57. package/dist/core/permission/tool-error-code.js +13 -1
  58. package/dist/core/permission/tool-policy.js +74 -20
  59. package/dist/core/relation/same-owner-proof.js +131 -0
  60. package/dist/core/session/session-idle-monitor.js +94 -16
  61. package/dist/core/session/session-manager.js +69 -16
  62. package/dist/core/thread/thread-route.js +5 -2
  63. package/dist/directory/owner-directory-cache.js +686 -97
  64. package/dist/directory/owner-directory-markdown.js +146 -36
  65. package/dist/directory/owner-directory-query-operation.js +2 -2
  66. package/dist/directory/owner-directory-scope.js +12 -0
  67. package/dist/directory/owner-directory-search.js +5 -1
  68. package/dist/directory/owner-directory-store.js +28 -0
  69. package/dist/ecweb/basic-settings-service.js +15 -1
  70. package/dist/ecweb/message-context-service.js +2 -2
  71. package/dist/ecweb/providers-service.js +3 -1
  72. package/dist/ecweb/runtime/lifecycle.js +18 -9
  73. package/dist/ecweb/runtime/supervisor.js +76 -24
  74. package/dist/index.js +4 -0
  75. package/dist/paths.js +2 -1
  76. package/dist/proxy/manager.js +2 -0
  77. package/dist/proxy/service-supervisor.js +2 -2
  78. package/dist/response-system/engines/v1/proactive-flow.js +4 -0
  79. package/dist/trigger/application-service.js +1 -0
  80. package/dist/trigger/event-source.js +4 -0
  81. package/dist/trigger/feedback.js +26 -2
  82. package/dist/trigger/scheduler.js +3 -3
  83. package/dist/trigger/system-definitions.js +2 -2
  84. package/dist/trigger/validation.js +4 -0
  85. package/dist/utils/autostart.js +2 -2
  86. package/dist/utils/cross-platform.js +36 -8
  87. package/dist/utils/public-suffix.js +5811 -0
  88. package/dist/utils/windows-autostart.js +41 -7
  89. package/ecagent/dist/harness/env/nodejs.js +46 -2
  90. package/kits/docs/aun/ABILITY_CALLING.md +3 -3
  91. package/kits/docs/channels/aun.md +1 -1
  92. package/kits/docs/channels/feishu.md +2 -2
  93. package/kits/docs/context-assembly.md +20 -4
  94. package/kits/docs/evolcore/INDEX.md +2 -1
  95. package/kits/docs/evolcore/agent.md +2 -2
  96. package/kits/docs/evolcore/aid.md +8 -2
  97. package/kits/docs/evolcore/ctl.md +13 -4
  98. package/kits/docs/evolcore/directory.md +48 -15
  99. package/kits/docs/evolcore/group.md +6 -6
  100. package/kits/docs/evolcore/memory-consolidation.md +1 -1
  101. package/kits/docs/evolcore/menu-protocol.md +32 -3
  102. package/kits/docs/evolcore/msg.md +28 -27
  103. package/kits/docs/evolcore/provider.md +39 -5
  104. package/kits/docs/evolcore/response.md +1 -1
  105. package/kits/docs/evolcore/thread-chain.md +11 -13
  106. package/kits/docs/evolcore/tool-authorization.md +17 -0
  107. package/kits/docs/evolcore/trigger.md +2 -2
  108. package/kits/docs/identity/ROLE_DETAIL.md +1 -1
  109. package/kits/docs/prompt-loading-architecture.md +30 -20
  110. package/kits/eck_manifest.auxiliary.json +5 -5
  111. package/kits/eck_manifest.json +28 -28
  112. package/kits/eck_manifest.memory.json +18 -18
  113. package/kits/rules/01-overview.md +1 -1
  114. package/kits/rules/06-channel.md +3 -3
  115. package/kits/schemas/_meta.json +7 -1
  116. package/kits/schemas/providers.schema.2.json +74 -0
  117. package/kits/schemas/role-registry.schema.1.json +1 -1
  118. package/kits/skills/ec-agent-create/SKILL.md +1 -0
  119. package/kits/skills/ec-service-proxy/SKILL.md +3 -10
  120. package/kits/skills/ec-trigger/SKILL.md +5 -5
  121. package/kits/skills/ec-trigger/references/examples.md +1 -1
  122. package/kits/templates/system-fragments/channel.md +5 -5
  123. package/kits/templates/system-fragments/commands.md +3 -2
  124. package/kits/templates/system-fragments/directory-contacts.md +10 -3
  125. package/kits/templates/system-fragments/personal-assistant.md +22 -3
  126. package/kits/templates/system-fragments/reply.md +47 -28
  127. package/kits/templates/system-fragments/session.md +2 -9
  128. package/kits/templates/system-fragments/thread.md +5 -5
  129. package/package.json +2 -3
@@ -12,7 +12,7 @@
12
12
  "var": "lifecycle",
13
13
  "eq": "active"
14
14
  },
15
- "description": "ECK 核心规则(自动加载)"
15
+ "description": "核心规则"
16
16
  },
17
17
  {
18
18
  "id": "bootstrap-guide",
@@ -24,7 +24,7 @@
24
24
  "var": "lifecycle",
25
25
  "eq": "bootstrapping"
26
26
  },
27
- "description": "Bootstrap 阶段专属引导提示词"
27
+ "description": "Bootstrap 引导"
28
28
  },
29
29
  {
30
30
  "id": "identity-layer",
@@ -44,7 +44,7 @@
44
44
  }
45
45
  ]
46
46
  },
47
- "description": "身份层:我是谁"
47
+ "description": "身份层"
48
48
  },
49
49
  {
50
50
  "id": "skills-builtin",
@@ -57,7 +57,7 @@
57
57
  "var": "lifecycle",
58
58
  "eq": "active"
59
59
  },
60
- "description": "内置技能索引"
60
+ "description": "内置技能"
61
61
  },
62
62
  {
63
63
  "id": "skills-local",
@@ -70,7 +70,7 @@
70
70
  "var": "lifecycle",
71
71
  "eq": "active"
72
72
  },
73
- "description": "本机技能索引"
73
+ "description": "本机技能"
74
74
  },
75
75
  {
76
76
  "id": "soul",
@@ -96,7 +96,7 @@
96
96
  }
97
97
  ]
98
98
  },
99
- "description": "常驻自我定义(00-GUIDE 机制 + 身份/性格/职责/操作铁律;空文件不注入)"
99
+ "description": "常驻自我"
100
100
  },
101
101
  {
102
102
  "id": "owner-directory",
@@ -117,7 +117,7 @@
117
117
  }
118
118
  ]
119
119
  },
120
- "description": "Owner 名录:Owner、个人助理、内部联系人、外部联系人与加入的群"
120
+ "description": "Owner 名录与 PA Team"
121
121
  },
122
122
  {
123
123
  "id": "contacts-profile",
@@ -142,7 +142,7 @@
142
142
  }
143
143
  ]
144
144
  },
145
- "description": "联系人名录使用说明(非个人助理):Owner/PA 是谁、当前准入开关状态、名录怎么查"
145
+ "description": "联系人名录"
146
146
  },
147
147
  {
148
148
  "id": "pa-profile",
@@ -167,7 +167,7 @@
167
167
  }
168
168
  ]
169
169
  },
170
- "description": "个人助理专属行为段(身份、对外联系、汇报与边界)"
170
+ "description": "个人助理"
171
171
  },
172
172
  {
173
173
  "id": "relation-layer",
@@ -190,7 +190,7 @@
190
190
  }
191
191
  ]
192
192
  },
193
- "description": "关系层:跟我聊天的是谁"
193
+ "description": "关系层"
194
194
  },
195
195
  {
196
196
  "id": "memory",
@@ -210,7 +210,7 @@
210
210
  }
211
211
  ]
212
212
  },
213
- "description": "记忆系统:何时写、怎么写、怎么召回"
213
+ "description": "记忆系统"
214
214
  },
215
215
  {
216
216
  "id": "agent-memory",
@@ -230,7 +230,7 @@
230
230
  }
231
231
  ]
232
232
  },
233
- "description": "agent 作用域记忆索引(consolidated)"
233
+ "description": "agent 记忆"
234
234
  },
235
235
  {
236
236
  "id": "owner-memory",
@@ -254,7 +254,7 @@
254
254
  }
255
255
  ]
256
256
  },
257
- "description": "owner 作用域记忆索引(consolidated,跨主机)"
257
+ "description": "Owner 记忆"
258
258
  },
259
259
  {
260
260
  "id": "relation-memory",
@@ -274,7 +274,7 @@
274
274
  }
275
275
  ]
276
276
  },
277
- "description": "relation 作用域记忆索引(consolidated,针对当前对端)"
277
+ "description": "对端记忆"
278
278
  },
279
279
  {
280
280
  "id": "venue-fragment",
@@ -294,7 +294,7 @@
294
294
  }
295
295
  ]
296
296
  },
297
- "description": "环境层模板(基础参数)"
297
+ "description": "环境层"
298
298
  },
299
299
  {
300
300
  "id": "venue-chattype",
@@ -314,7 +314,7 @@
314
314
  }
315
315
  ]
316
316
  },
317
- "description": "场景通用文档(private/group)"
317
+ "description": "场景环境"
318
318
  },
319
319
  {
320
320
  "id": "venue-channel-chattype",
@@ -334,7 +334,7 @@
334
334
  }
335
335
  ]
336
336
  },
337
- "description": "渠道+场景文档(如 feishu-group)"
337
+ "description": "渠道场景环境"
338
338
  },
339
339
  {
340
340
  "id": "group-history",
@@ -362,7 +362,7 @@
362
362
  }
363
363
  ]
364
364
  },
365
- "description": "AUN 群聊的本地只读历史查询指引"
365
+ "description": "群历史"
366
366
  },
367
367
  {
368
368
  "id": "relation-group-rules",
@@ -382,7 +382,7 @@
382
382
  }
383
383
  ]
384
384
  },
385
- "description": "群资源空间同步的群规则"
385
+ "description": "群规则"
386
386
  },
387
387
  {
388
388
  "id": "venue-client",
@@ -402,7 +402,7 @@
402
402
  }
403
403
  ]
404
404
  },
405
- "description": "客户端环境文档"
405
+ "description": "客户端环境"
406
406
  },
407
407
  {
408
408
  "id": "thread",
@@ -425,7 +425,7 @@
425
425
  }
426
426
  ]
427
427
  },
428
- "description": "话题系统:话题列表/历史、跨话题发送、命名、摘要与状态"
428
+ "description": "话题系统"
429
429
  },
430
430
  {
431
431
  "id": "reply-contract",
@@ -448,7 +448,7 @@
448
448
  }
449
449
  ]
450
450
  },
451
- "description": "共用回复规则:当前模式、目标及托管发送边界"
451
+ "description": "回复规则"
452
452
  },
453
453
  {
454
454
  "id": "channel-layer",
@@ -468,7 +468,7 @@
468
468
  }
469
469
  ]
470
470
  },
471
- "description": "渠道层:通信渠道及能力"
471
+ "description": "渠道层"
472
472
  },
473
473
  {
474
474
  "id": "commands",
@@ -488,7 +488,7 @@
488
488
  }
489
489
  ]
490
490
  },
491
- "description": "命令集能力卡:按场景列出可用命令集及文档路径"
491
+ "description": "命令集"
492
492
  },
493
493
  {
494
494
  "id": "session",
@@ -500,7 +500,7 @@
500
500
  "var": "lifecycle",
501
501
  "eq": "active"
502
502
  },
503
- "description": "会话层:当前会话实例状态"
503
+ "description": "会话"
504
504
  },
505
505
  {
506
506
  "id": "baseagent",
@@ -520,7 +520,7 @@
520
520
  }
521
521
  ]
522
522
  },
523
- "description": "Base Agent 特定配置"
523
+ "description": "base agent"
524
524
  },
525
525
  {
526
526
  "id": "bash-description",
@@ -540,7 +540,7 @@
540
540
  }
541
541
  ]
542
542
  },
543
- "description": "Bash 调用 description 格式:目标描述 + 风险等级标记"
543
+ "description": "Bash 格式"
544
544
  },
545
545
  {
546
546
  "id": "managed-runtime-notice",
@@ -552,7 +552,7 @@
552
552
  "var": "lifecycle",
553
553
  "eq": "active"
554
554
  },
555
- "description": "托管运行时提示:上下文已就绪,勿重复读取"
555
+ "description": "托管运行时"
556
556
  }
557
557
  ]
558
558
  }
@@ -19,7 +19,7 @@
19
19
  }
20
20
  ]
21
21
  },
22
- "description": "记忆系统(整理会话分支):三个写命令、模式权限、禁止事项"
22
+ "description": "记忆系统"
23
23
  },
24
24
  {
25
25
  "id": "memory-workflow",
@@ -31,7 +31,7 @@
31
31
  "var": "lifecycle",
32
32
  "eq": "active"
33
33
  },
34
- "description": "整理会话流程:读上下文、查重、取舍、收尾"
34
+ "description": "整理流程"
35
35
  },
36
36
  {
37
37
  "id": "memory-tags",
@@ -43,7 +43,7 @@
43
43
  "var": "lifecycle",
44
44
  "eq": "active"
45
45
  },
46
- "description": "记忆标签取值全集与升级标记用法"
46
+ "description": "记忆标签"
47
47
  },
48
48
  {
49
49
  "id": "soul",
@@ -61,7 +61,7 @@
61
61
  "var": "lifecycle",
62
62
  "eq": "active"
63
63
  },
64
- "description": "常驻自我定义(判断记忆取舍时的行为准则参考;空文件不注入)"
64
+ "description": "常驻自我"
65
65
  },
66
66
  {
67
67
  "id": "peer-profile",
@@ -81,7 +81,7 @@
81
81
  }
82
82
  ]
83
83
  },
84
- "description": "当前对端画像(profile 标签的记忆)"
84
+ "description": "对端画像"
85
85
  },
86
86
  {
87
87
  "id": "owner-directory",
@@ -102,7 +102,7 @@
102
102
  }
103
103
  ]
104
104
  },
105
- "description": "Owner 名录(本 agent 准入范围内的联系人与个人助理)"
105
+ "description": "Owner 名录与 PA Team"
106
106
  },
107
107
  {
108
108
  "id": "contacts-profile",
@@ -127,7 +127,7 @@
127
127
  }
128
128
  ]
129
129
  },
130
- "description": "联系人名录使用说明(非个人助理):Owner/PA 是谁、当前准入开关状态、名录怎么查"
130
+ "description": "联系人名录"
131
131
  },
132
132
  {
133
133
  "id": "pa-profile",
@@ -152,7 +152,7 @@
152
152
  }
153
153
  ]
154
154
  },
155
- "description": "个人助理专属行为段(身份、对外联系、汇报与边界)"
155
+ "description": "个人助理"
156
156
  },
157
157
  {
158
158
  "id": "memory-mode-notes",
@@ -172,7 +172,7 @@
172
172
  }
173
173
  ]
174
174
  },
175
- "description": "notes 模式的操作说明"
175
+ "description": "notes 模式"
176
176
  },
177
177
  {
178
178
  "id": "memory-mode-generalize",
@@ -192,7 +192,7 @@
192
192
  }
193
193
  ]
194
194
  },
195
- "description": "generalize 模式的操作说明"
195
+ "description": "generalize 模式"
196
196
  },
197
197
  {
198
198
  "id": "memory-mode-promote",
@@ -212,7 +212,7 @@
212
212
  }
213
213
  ]
214
214
  },
215
- "description": "promote 模式的操作说明"
215
+ "description": "promote 模式"
216
216
  },
217
217
  {
218
218
  "id": "memory-mode-profile",
@@ -232,7 +232,7 @@
232
232
  }
233
233
  ]
234
234
  },
235
- "description": "profile 模式的操作说明"
235
+ "description": "profile 模式"
236
236
  },
237
237
  {
238
238
  "id": "memory-mode-forget",
@@ -252,7 +252,7 @@
252
252
  }
253
253
  ]
254
254
  },
255
- "description": "forget 模式的操作说明"
255
+ "description": "forget 模式"
256
256
  },
257
257
  {
258
258
  "id": "agent-memory",
@@ -272,7 +272,7 @@
272
272
  }
273
273
  ]
274
274
  },
275
- "description": "agent 作用域记忆索引(consolidated)"
275
+ "description": "agent 记忆"
276
276
  },
277
277
  {
278
278
  "id": "owner-memory",
@@ -296,7 +296,7 @@
296
296
  }
297
297
  ]
298
298
  },
299
- "description": "owner 作用域记忆索引(consolidated,跨主机)"
299
+ "description": "Owner 记忆"
300
300
  },
301
301
  {
302
302
  "id": "relation-memory",
@@ -316,7 +316,7 @@
316
316
  }
317
317
  ]
318
318
  },
319
- "description": "relation 作用域记忆索引(consolidated,针对当前对端)"
319
+ "description": "对端记忆"
320
320
  },
321
321
  {
322
322
  "id": "session",
@@ -328,7 +328,7 @@
328
328
  "var": "lifecycle",
329
329
  "eq": "active"
330
330
  },
331
- "description": "会话层:当前会话实例状态"
331
+ "description": "会话"
332
332
  },
333
333
  {
334
334
  "id": "bash-description",
@@ -348,7 +348,7 @@
348
348
  }
349
349
  ]
350
350
  },
351
- "description": "Bash 调用 description 格式:目标描述 + 风险等级标记"
351
+ "description": "Bash 格式"
352
352
  }
353
353
  ]
354
354
  }
@@ -159,7 +159,7 @@ manifest schema、when 条件、合并覆盖、模板渲染、运行时变量目
159
159
  命令会被拒绝——`ec` 只接受能确认为字面量的命令。
160
160
 
161
161
  **正文本身含单引号时**,改用 bash ANSI-C quoting:`$'…'`。
162
- 内部支持转义:`\'` `\n` `\t` `\\`。例:`ec msg send $'it\'s fine'`。
162
+ 内部支持转义:`\'` `\n` `\t` `\\`。例:`ecmsg send $'it\'s fine'`。
163
163
 
164
164
  ## 术语
165
165
 
@@ -24,14 +24,14 @@
24
24
  - interactive:直接输出即回复
25
25
  - proactive:通过托管发送通道正式回复,见 `[reply]` 段(thought.put vs message.send)
26
26
  - **附加能力与模式无关、始终需要 CLI**:发文件/图片/语音、@某人、加密、联系第三方
27
- - **以自己的 AID 为发送者**;拿不到时退回 `ec ctl send '<text>'`
27
+ - **发送统一用 `ecmsg send`**:本端恒为当前会话本端,无需指定
28
28
 
29
29
  ### 命令返回值
30
30
 
31
31
  判断成败**看 exit code**,别靠字符串前缀——各命令集格式不统一:
32
32
 
33
- - `ec ctl send`:成功打印 `ok`;失败把**裸错误信息**打到 stderr(如 `消息内容不能为空`、`adapter 未找到: feishu`),exit≠0
34
- - `ec msg` / `ec group` 发送类:成功 `✓ 已发送 message_id=… seq=…`;失败 `❌ 发送失败: <原因>`,exit≠0
33
+ - `ecmsg send`(AUN 目标):成功 `✓ 已发送 from=… to=… thread=… message_id=… seq=…`;失败退出码非 0
34
+ - `ecmsg send`(非 AUN 渠道):成功 `✓ 已发送 … status=sent message_id=n/a`;该通道不返回 message_id
35
35
 
36
36
  发送成功后**继续后续处理**。一次任务可能发 0 到多条消息不要因为看到"已发送"就反复发送同一条消息。
37
37
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemas": {
3
3
  "providers": {
4
- "currentVersion": 1
4
+ "currentVersion": 2
5
5
  },
6
6
  "daemon": {
7
7
  "currentVersion": 9
@@ -64,6 +64,12 @@
64
64
  }
65
65
  },
66
66
  "history": [
67
+ {
68
+ "schema": "providers",
69
+ "version": 2,
70
+ "date": "2026-11-06",
71
+ "description": "域名哈希稳定 Provider ID、规范域名和旧 ID 兼容映射"
72
+ },
67
73
  {
68
74
  "schema": "role-config",
69
75
  "version": 2,
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "providers.schema.2.json",
4
+ "title": "Providers (providers.json)",
5
+ "description": "域名稳定 Provider ID、旧 ID 兼容映射及公共接入参数。",
6
+ "x-logical-name": "providers",
7
+ "x-scope": "providers",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": ["$schema_version", "providers"],
11
+ "properties": {
12
+ "$schema_version": { "type": "integer", "const": 2, "default": 2, "x-merge": "scalar" },
13
+ "nextId": { "type": "integer", "minimum": 1, "maximum": 9007199254740991, "x-merge": "scalar" },
14
+ "aliases": {
15
+ "type": "object", "x-merge": "dict",
16
+ "propertyNames": { "$ref": "#/definitions/identifier" },
17
+ "additionalProperties": { "$ref": "#/definitions/identifier" }
18
+ },
19
+ "providers": {
20
+ "type": "object", "default": {}, "x-merge": "dict",
21
+ "propertyNames": { "$ref": "#/definitions/identifier" },
22
+ "additionalProperties": { "$ref": "#/definitions/provider" }
23
+ }
24
+ },
25
+ "definitions": {
26
+ "identifier": { "type": "string", "pattern": "^(?!(?:__proto__|prototype|constructor)$)[A-Za-z0-9_-]+$" },
27
+ "stringMap": {
28
+ "type": "object",
29
+ "propertyNames": { "not": { "enum": ["__proto__", "prototype", "constructor"] }, "pattern": "\\S" },
30
+ "additionalProperties": { "type": "string" }
31
+ },
32
+ "provider": {
33
+ "type": "object", "additionalProperties": false, "required": ["common"],
34
+ "properties": {
35
+ "name": { "type": "string" },
36
+ "domain": { "type": "string", "minLength": 1 },
37
+ "common": {
38
+ "type": "object", "additionalProperties": false, "required": ["baseUrl"],
39
+ "properties": {
40
+ "baseUrl": { "type": "string", "minLength": 1 },
41
+ "apiKey": { "type": "string" },
42
+ "headers": { "$ref": "#/definitions/stringMap" },
43
+ "queryParams": { "$ref": "#/definitions/stringMap" }
44
+ }
45
+ },
46
+ "services": {
47
+ "type": "object",
48
+ "propertyNames": { "allOf": [{ "$ref": "#/definitions/identifier" }, { "not": { "const": "auxiliary" } }] },
49
+ "additionalProperties": { "$ref": "#/definitions/service" }
50
+ }
51
+ }
52
+ },
53
+ "service": {
54
+ "type": "object", "additionalProperties": false,
55
+ "properties": {
56
+ "path": { "type": "string" },
57
+ "style": { "type": "string", "minLength": 1 },
58
+ "models": {
59
+ "type": "object",
60
+ "propertyNames": { "not": { "enum": ["__proto__", "prototype", "constructor"] }, "pattern": "\\S" },
61
+ "additionalProperties": {
62
+ "type": "object", "additionalProperties": false,
63
+ "properties": {
64
+ "enabled": { "type": ["boolean", "null"] },
65
+ "name": { "type": ["string", "null"] },
66
+ "imageIn": { "type": ["boolean", "null"] },
67
+ "manual": { "type": "boolean" }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -28,7 +28,7 @@
28
28
  "properties": {
29
29
  "private": { "type": ["string", "null"], "pattern": "^(?!owner$)[a-z0-9_-]+$", "default": null, "description": "私聊默认角色;必须已注册且不能为 owner。" },
30
30
  "group": { "type": ["string", "null"], "pattern": "^(?!owner$)[a-z0-9_-]+$", "default": null, "description": "群聊默认角色;必须已注册且不能为 owner。" },
31
- "paTeam": { "type": ["string", "null"], "pattern": "^(?!owner$)[a-z0-9_-]+$", "default": "member", "description": "同 Owner 且双方为 pa.* Agent 的私聊默认角色;未设置或 null 时独立默认为 member,不继承 private。必须已注册且不能为 owner。" }
31
+ "paTeam": { "type": ["string", "null"], "pattern": "^(?!owner$)[a-z0-9_-]+$", "default": "member", "description": "同 Owner 内部 Agent 的私聊默认角色(配置键兼容保留);未设置或 null 时独立默认为 member,不继承 private。必须已注册且不能为 owner。" }
32
32
  },
33
33
  "x-merge": "dict"
34
34
  }
@@ -45,6 +45,7 @@ license: MIT
45
45
 
46
46
  - 初始化必须显式提供 `--owner`、`--name`、`--description`、`--tags`。
47
47
  `tags` 是标签的 JSON 数组;标签只含 Unicode 字母、数字和连字符,每项最长 50 字符。
48
+ - 需要固定推理服务商时可在初始化或 Bootstrap 创建命令中传 `--provider <id>`;该值必须支持所选 `--baseagent`。
48
49
  - 缺少最终字段且要交由新 Agent 澄清时,显式选择 `--bootstrap`;默认模式不会自动降级。
49
50
  - 两种模式互斥,均隐含非交互创建。`--non-interactive` 不改变默认初始化模式。
50
51
  - persona 和头像可选;未提供时跳过,不为了这些可选项额外追加确认轮次。
@@ -114,6 +114,9 @@ restart / reload 按 runtime.mode 执行:managed 经其 supervisor 或内部
114
114
 
115
115
  ## 监听与守护
116
116
 
117
+ - EvolCore 核心就绪与服务健康分开判定;ECWeb 尚未就绪或恢复失败不会使已就绪的 daemon 启动失败。正常启动、重启与核心 IPC 超时兜底不等待 ECWeb 协议握手。
118
+ - 服务启动等待由 `health.startupTimeoutMs` 决定,默认 45 秒,不沿用 CLI 的 30 秒核心启动等待。ECWeb 同样采用此预算,并读取 `health.failureThreshold` 和 `health.timeoutMs`;为核验实例身份,其存活探针固定使用 `/api/health`,不使用自定义路径。
119
+ - ECWeb 存活与其连接 daemon 的协议就绪分开:身份匹配的存活实例不会仅因 daemon 握手尚未完成而被反复重启。核心确实启动失败时,重启监控仍会安全清理遗留的 ECWeb,避免回滚后重复启动。
117
120
  - 运行状态周期检查进程和配置的 HTTP/TCP 健康探针,默认连续失败 3 次才触发恢复,成功一次清零连续失败数。
118
121
  - TCP 启动中每 500 ms、运行中每 10 秒检查;HTTP 启动中每 1 秒、运行中每 15 秒检查,频率固定。
119
122
  - managed 服务在 15 分钟内最多自动重试 3 次,默认等待 5、10、20 秒;仅 backoffMs 可调整初始等待。
@@ -125,16 +128,6 @@ restart / reload 按 runtime.mode 执行:managed 经其 supervisor 或内部
125
128
  - 主动 stop 或 disabled 的服务不会被后台重新启动。
126
129
  - managed 服务的进程只会按 supervisor 写入的 PID 和启动时间记录管理;不要建议按端口强杀进程。
127
130
 
128
- ### 端口冲突与状态判读
129
-
130
- - 普通 managed 服务启动前先核对实例记录与端口。只有 PID、启动时间和配置匹配才复用现存实例;未知端口占用者不接管、不终止,也不消耗自动重试额度。
131
- - 配置改变需替换旧实例时,先确认旧进程退出。停止超时或身份无法核验时保留 PID 与记录,拒绝启动替代进程,不把 stop/restart 报为成功。
132
- - 实例启动后先登记 `starting`,健康检查通过才更新为 `ready`;代理发现不发布尚未就绪的 supervisor 实例。
133
- - `runtime.state` 表示管理状态,`endpointHealth` 表示端点探测结果,`processOwnership` 表示受管归属。`failed + healthy + unknown` 表示端点可响应但未被安全接管,不等于服务已宕机。
134
- - `endpointOwnerPids` 列出冲突监听者;`lastErrorCode` 与 `lastError` 保留原始失败原因,`recoveryState=blocked/exhausted` 分别表示恢复受阻或额度耗尽。不要仅凭 HTTP 200 认定身份或代理链路已验证。
135
- - 端口冲突期间仍低频探测;冲突解除且自动恢复已开启时重新对账启动。关闭自动恢复或主动 stop 后不会自动拉起。
136
- - `logs/services/<name>.log` 保留原始 stdout/stderr,并增加带时间戳、服务名、启动批次和 PID 的生命周期 JSON 标记;原始输出行不保证逐行带时间戳,按批次关联,不能据此强行做逐行时间统计。
137
-
138
131
  变更后用 ec proxy status <name> 复核 desired 配置、进程健康和代理登记状态。写操作返回失败时读取
139
132
  具体错误码处理;不要重复发送不确定的 start/restart 操作。
140
133
 
@@ -35,7 +35,7 @@ license: MIT
35
35
 
36
36
  | 类型 | 谁在执行 | 用在哪 | 坑 |
37
37
  |---|---|---|---|
38
- | `trigger-session` | daemon 专属的 trigger 会话,**与用户对话隔离** | 周期巡检、生成摘要、独立判断。默认同 trigger 复用一条会话 | 始终继承所属 Agent 当前基座;`--trigger-thread per-run` 每次都开新会话 |
38
+ | `trigger-session` | daemon 专属的 trigger 会话,**与用户对话隔离** | 周期巡检、生成摘要、独立判断。默认同 trigger 复用一条会话 | 只有它支持 `--baseagent`;`--trigger-thread per-run` 每次都开新会话 |
39
39
  | `target-session` | 把提示词**当成一条消息**投进目标会话,由那个会话的 agent 处理 | 要在用户的对话里、带着上下文做的事;跨话题复查(`--check-every`) | 不支持 `feedback=silent`;目标会话被占用会等/冲突;也**不支持** `execution.thread` |
40
40
  | `script` | 确定性脚本,不过模型 | 只看数、查文件、调 IPC、算东西——**不需要模型判断**时优先用,又快又便宜 | 走沙箱,脚本不能读受保护路径;宿主执行要求独立批准 |
41
41
 
@@ -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 停机、时区 |
@@ -146,7 +146,7 @@ trigger-session 生成正文后由目标会话自己发文件:
146
146
 
147
147
  ## 6. 跨话题复查(只有懂这个形状才手写)
148
148
 
149
- 正常用 `ec msg send '...' --thread <T2> --check-every 5m` 生成,不要手写。要点:
149
+ 正常用 `ecmsg send '...' --thread <T2> --check-every 5m` 生成,不要手写。要点:
150
150
 
151
151
  - `labels.kind = "cross-thread-review"` 决定投递身份取**目标话题自身**的对端,而不是来源对端。
152
152
  - 只支持 `target_session`,`feedback.target.session = "thread"` 且带 `threadId`。
@@ -14,14 +14,14 @@ capabilities: {{capabilities}} # 当前渠道支持的能力
14
14
  {{/}}
15
15
  {{?channel=aun}}
16
16
  {{?groupId}}
17
- ec group send {{selfAid}} {{groupId}} '<text>' [--encrypt|--no-encrypt] [--file <path> --as image|video|voice|file] [--payload '<json>'] [--mention '<aid1>,<aid2>'] [--mention-all]
18
- group-send 用于群内公开发送;群聊固定为 proactive,正式回复使用此命令。
17
+ ecmsg send '<text>' [--file <path> --as image|video|voice|file] [--payload '<json>'] [--mention '<aid1>,<aid2>'] [--mention-all]
18
+ 群聊会话下 `ecmsg send` 即群内公开发送,无需写群 AID。
19
19
  {{/}}
20
20
  {{?peerId}}
21
- 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>' --return none|required --timeout <duration> --format json]
22
- msg-send 用于私聊发送:proactive/paactive 下是正式回复;interactive 下普通回复直接输出,需要文件、链接或手动控制加密时使用此命令。paactive 的普通模型文本由框架投影为 activity。群聊仅在确需私下联系本条消息发送者且已获授权时使用,公开回复使用 group-send。
21
+ ecmsg send '<text>' [--text-from-file <path>] [--encrypt yes|no|auto] [--file <path> --as image|video|voice|file] [--link <url> --title '<title>'] [--payload '<json>' --return none|required --timeout <duration> --format json]
22
+ `ecmsg send` 在 proactive/paactive 下是正式回复;interactive 下普通回复直接输出,只在需要文件、链接或手动控制加密时才用。paactive 的普通模型文本由框架投影为 activity。
23
23
  当用户想获取、读取、查询或汇总属于某个主体的数据时,无论主体通过“我/你”、姓名、关系称谓还是 AID 指代,都先依据当前关系层、明确 AID 或可靠身份/联系人信息确认主体是谁并解析到准确 AID;姓名不明或有歧义时才询问。必要时加载 `ec-identity` 解析姓名。随后加载内置技能 `aid-ability`,检查该主体 AID 是否发布了匹配的数据能力;数据类型和来源不设限。若数据由关联设备或服务提供,只能依据能力索引或可信身份信息确认对应 Provider AID,不得猜测。
24
- 用户要求发现或调用其他 AID 的能力时使用 `aid-ability`。用户要求给当前 Agent/主机添加、开发、安装、启用、发布、下架、升级或诊断本端插件时使用 `ec-ability`。仅出现 `ability` 等术语不足以判定要调用远端能力;按用户要做的事分流。若用户只询问远端调用流程/可行性或明确要求不要执行,只说明身份解析、能力发现与调用步骤,不读取索引、不调用能力。实际调用时不要猜测能力路径或参数:读取目标 AID 的能力索引,必要时执行在线发现,再按结构化契约构造原始 JSON。需要结果时使用 `ec msg send --return required`;它会按 `--timeout`(默认 60s,最大 3600s)使用 AUN volatile 非持久消息。等待超时后用 `ec msg request get` 查询,不要自动重发。`message_id` 只表示传输 ACK,不表示能力执行完成。
24
+ 用户要求发现或调用其他 AID 的能力时使用 `aid-ability`。用户要求给当前 Agent/主机添加、开发、安装、启用、发布、下架、升级或诊断本端插件时使用 `ec-ability`。仅出现 `ability` 等术语不足以判定要调用远端能力;按用户要做的事分流。若用户只询问远端调用流程/可行性或明确要求不要执行,只说明身份解析、能力发现与调用步骤,不读取索引、不调用能力。实际调用时不要猜测能力路径或参数:读取目标 AID 的能力索引,必要时执行在线发现,再按结构化契约构造原始 JSON。需要结果时使用 `ecmsg send --to <AID> --return required`;它会按 `--timeout`(默认 60s,最大 3600s)使用 AUN volatile 非持久消息。等待超时后用 `ec msg request get` 查询,不要自动重发。`message_id` 只表示传输 ACK,不表示能力执行完成。
25
25
  {{/}}
26
26
  每次调用仍须遵守 `[reply]` 的单条命令及加密要求。
27
27
  {{/}}