evolcore 0.0.24 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/CHANGELOG.md +578 -561
  2. package/LICENSE +21 -21
  3. package/README.md +455 -455
  4. package/bin/codex-managed-acl.ps1 +160 -160
  5. package/bin/codex-managed-hook.mjs +208 -208
  6. package/bin/ec-safe-output.js +327 -327
  7. package/bin/ec.js +29 -29
  8. package/bin/install-codex-managed-hooks.mjs +555 -555
  9. package/dist/agents/claude-runner.js +4 -1
  10. package/dist/agents/codex-runner.js +7 -4
  11. package/dist/agents/ecagent-runner.js +14 -13
  12. package/dist/agents/gemini-runner.js +22 -2
  13. package/dist/aun/aid/agentmd.js +56 -4
  14. package/dist/aun/aid/index.js +1 -0
  15. package/dist/aun/aid/managed-operation.js +53 -1
  16. package/dist/aun/storage/client.js +4 -1
  17. package/dist/aun/storage/index.js +1 -1
  18. package/dist/cli/agent-command.js +186 -87
  19. package/dist/cli/agent-create.js +42 -4
  20. package/dist/cli/agent.js +103 -1
  21. package/dist/cli/aun-commands.js +360 -294
  22. package/dist/cli/bench.js +20 -20
  23. package/dist/cli/config.js +20 -20
  24. package/dist/cli/contact.js +10 -10
  25. package/dist/cli/ctl-command.js +22 -22
  26. package/dist/cli/daemon-commands.js +15 -15
  27. package/dist/cli/fs-command.js +67 -67
  28. package/dist/cli/handoff-command.js +7 -7
  29. package/dist/cli/index.js +77 -77
  30. package/dist/cli/link-rules.js +21 -21
  31. package/dist/cli/menu-client.js +11 -11
  32. package/dist/cli/net-check.js +22 -22
  33. package/dist/cli/queue-command.js +29 -29
  34. package/dist/cli/response.js +30 -30
  35. package/dist/cli/restart-monitor.js +30 -30
  36. package/dist/cli/stats.js +51 -51
  37. package/dist/cli/trigger-command.js +56 -56
  38. package/dist/config/builtin-roles.js +1 -0
  39. package/dist/config/config-manager.js +15 -0
  40. package/dist/config/config-operation-service.js +20 -3
  41. package/dist/config/resolved-config-op.js +39 -1
  42. package/dist/core/auth/operation-authorizer.js +62 -4
  43. package/dist/core/auth/operation-catalog.js +16 -0
  44. package/dist/core/command/agent-control.js +54 -25
  45. package/dist/core/command/cli-intent-parser.js +18 -0
  46. package/dist/core/command/command-handler.js +91 -16
  47. package/dist/core/command/menu-catalog.js +1 -0
  48. package/dist/core/command/menu-handler.js +41 -5
  49. package/dist/core/command/menu-protocol.js +1 -0
  50. package/dist/core/command/slash-handler.js +9 -9
  51. package/dist/core/event-catalog.js +5 -0
  52. package/dist/core/evolagent.js +3 -3
  53. package/dist/core/message/response-engine.js +12 -6
  54. package/dist/core/permission/tool-policy.js +45 -6
  55. package/dist/index.js +209 -162
  56. package/dist/stats/db.js +159 -159
  57. package/dist/stats/eck-vars.js +9 -9
  58. package/dist/stats/query.js +139 -139
  59. package/dist/stats/role-budget.js +6 -6
  60. package/dist/stats/writer.js +51 -51
  61. package/dist/utils/avatar-upload.js +282 -23
  62. package/dist/utils/error-dict.json +160 -160
  63. package/dist/utils/macos-autostart.js +22 -22
  64. package/dist/utils/model-prices.jsonl +23 -23
  65. package/dist/utils/welcome.js +22 -22
  66. package/ecagent/LICENSE +21 -21
  67. package/ecagent/NOTICE +11 -11
  68. package/ecagent/README.md +61 -61
  69. package/ecagent/dist/harness/compaction/branch-summarization.js +30 -30
  70. package/ecagent/dist/harness/compaction/compaction.js +83 -83
  71. package/ecagent/dist/harness/messages.js +7 -7
  72. package/kits/docs/GUIDE.md +20 -20
  73. package/kits/docs/INDEX.md +66 -66
  74. package/kits/docs/aun/CHEATSHEET.md +19 -19
  75. package/kits/docs/aun/SYNC_PROTOCOL.md +15 -15
  76. package/kits/docs/channels/aun.md +56 -56
  77. package/kits/docs/channels/feishu.md +56 -56
  78. package/kits/docs/context-assembly.md +365 -364
  79. package/kits/docs/eck_templates/GUIDE.template.md +22 -22
  80. package/kits/docs/eck_templates/INDEX.template.md +28 -28
  81. package/kits/docs/eck_templates/path-registry.template.md +33 -33
  82. package/kits/docs/eck_templates/runtime.template.md +19 -19
  83. package/kits/docs/evolcore/INDEX.md +71 -69
  84. package/kits/docs/evolcore/agent-create.md +170 -156
  85. package/kits/docs/evolcore/agent.md +83 -73
  86. package/kits/docs/evolcore/aid.md +64 -62
  87. package/kits/docs/evolcore/codex-windows-sandbox.md +146 -0
  88. package/kits/docs/evolcore/config.md +195 -195
  89. package/kits/docs/evolcore/contact.md +68 -68
  90. package/kits/docs/evolcore/ctl.md +46 -46
  91. package/kits/docs/evolcore/event.md +216 -216
  92. package/kits/docs/evolcore/fs-architecture.md +1215 -1215
  93. package/kits/docs/evolcore/fs.md +110 -110
  94. package/kits/docs/evolcore/group-collaboration.md +243 -243
  95. package/kits/docs/evolcore/group-fs.md +17 -17
  96. package/kits/docs/evolcore/group-rules.md +251 -251
  97. package/kits/docs/evolcore/group.md +152 -152
  98. package/kits/docs/evolcore/menu-client.md +34 -34
  99. package/kits/docs/evolcore/model.md +50 -50
  100. package/kits/docs/evolcore/msg.md +165 -165
  101. package/kits/docs/evolcore/response.md +75 -75
  102. package/kits/docs/evolcore/rpc.md +37 -37
  103. package/kits/docs/evolcore/self-summary.md +29 -29
  104. package/kits/docs/evolcore/stats.md +83 -83
  105. package/kits/docs/evolcore/storage.md +50 -50
  106. package/kits/docs/evolcore/trigger.md +575 -575
  107. package/kits/docs/identity/AID_PROFILE_SPEC.md +26 -26
  108. package/kits/docs/identity/PATH_OPS.md +16 -16
  109. package/kits/docs/identity/ROLE_DETAIL.md +25 -25
  110. package/kits/docs/identity/identity-tools.md +26 -26
  111. package/kits/docs/path-registry.md +62 -62
  112. package/kits/docs/prompt-loading-architecture.md +270 -269
  113. package/kits/docs/venues/aun-group.md +45 -45
  114. package/kits/docs/venues/aun-private.md +10 -10
  115. package/kits/docs/venues/client-desktop.md +10 -10
  116. package/kits/docs/venues/client-mobile.md +10 -10
  117. package/kits/docs/venues/feishu-group.md +13 -13
  118. package/kits/docs/venues/feishu-private.md +9 -9
  119. package/kits/docs/venues/group.md +25 -25
  120. package/kits/docs/venues/private.md +10 -10
  121. package/kits/eck_manifest.auxiliary.json +43 -43
  122. package/kits/eck_manifest.json +195 -183
  123. package/kits/eck_message_manifest.json +74 -74
  124. package/kits/migrations/README-role-config-v4.md +32 -32
  125. package/kits/migrations/migrate-contact-book-v2.mjs +748 -748
  126. package/kits/migrations/migrate-role-config-v4.mjs +614 -614
  127. package/kits/migrations/migrate-role-config-v5.mjs +365 -365
  128. package/kits/migrations/rename-config-file.mjs +99 -99
  129. package/kits/rules/01-overview.md +162 -162
  130. package/kits/rules/02-navigation.md +96 -96
  131. package/kits/rules/03-identity.md +39 -37
  132. package/kits/rules/04-relation.md +75 -75
  133. package/kits/rules/05-venue.md +60 -60
  134. package/kits/rules/06-channel.md +63 -63
  135. package/kits/schemas/_meta.json +53 -53
  136. package/kits/schemas/agent-config.schema.1.json +177 -177
  137. package/kits/schemas/agent-config.schema.10.json +395 -395
  138. package/kits/schemas/agent-config.schema.11.json +421 -421
  139. package/kits/schemas/agent-config.schema.12.json +427 -427
  140. package/kits/schemas/agent-config.schema.2.json +239 -239
  141. package/kits/schemas/agent-config.schema.3.json +119 -119
  142. package/kits/schemas/agent-config.schema.4.json +208 -208
  143. package/kits/schemas/agent-config.schema.5.json +326 -326
  144. package/kits/schemas/agent-config.schema.6.json +322 -322
  145. package/kits/schemas/agent-config.schema.7.json +303 -303
  146. package/kits/schemas/agent-config.schema.8.json +304 -304
  147. package/kits/schemas/agent-config.schema.9.json +364 -364
  148. package/kits/schemas/contact-book.schema.1.json +36 -36
  149. package/kits/schemas/contact-book.schema.2.json +43 -43
  150. package/kits/schemas/contact-book.schema.3.json +67 -67
  151. package/kits/schemas/daemon.schema.1.json +91 -91
  152. package/kits/schemas/daemon.schema.2.json +101 -101
  153. package/kits/schemas/daemon.schema.3.json +123 -123
  154. package/kits/schemas/daemon.schema.4.json +136 -136
  155. package/kits/schemas/daemon.schema.5.json +135 -135
  156. package/kits/schemas/daemon.schema.6.json +131 -131
  157. package/kits/schemas/defaults.schema.1.json +81 -81
  158. package/kits/schemas/defaults.schema.2.json +85 -85
  159. package/kits/schemas/defaults.schema.3.json +73 -73
  160. package/kits/schemas/defaults.schema.4.json +107 -107
  161. package/kits/schemas/defaults.schema.5.json +119 -119
  162. package/kits/schemas/menu-exec-schema-commands.md +208 -208
  163. package/kits/schemas/migrations/README.md +30 -30
  164. package/kits/schemas/relation-config.schema.1.json +158 -158
  165. package/kits/schemas/relation-config.schema.2.json +73 -73
  166. package/kits/schemas/relation-config.schema.3.json +50 -50
  167. package/kits/schemas/relation-config.schema.4.json +47 -47
  168. package/kits/schemas/relation-config.schema.5.json +47 -47
  169. package/kits/schemas/relation-config.schema.6.json +46 -46
  170. package/kits/schemas/relation-config.schema.7.json +59 -59
  171. package/kits/schemas/relation-config.schema.8.json +103 -103
  172. package/kits/schemas/role-config.schema.1.json +201 -201
  173. package/kits/schemas/role-registry.schema.1.json +35 -35
  174. package/kits/schemas/single-session.schema.1.json +31 -31
  175. package/kits/schemas/single-session.schema.2.json +57 -57
  176. package/kits/schemas/single-session.schema.3.json +32 -32
  177. package/kits/templates/bootstrap-welcome.md +17 -17
  178. package/kits/templates/message-fragments/handoff-context-to-target.md +9 -9
  179. package/kits/templates/message-fragments/handoff-request-to-target.md +19 -19
  180. package/kits/templates/message-fragments/handoff-response-to-origin.md +9 -9
  181. package/kits/templates/message-fragments/inject-default.md +2 -2
  182. package/kits/templates/message-fragments/item.md +2 -2
  183. package/kits/templates/roles/admin.json +96 -84
  184. package/kits/templates/roles/member.json +97 -96
  185. package/kits/templates/roles/owner.json +9 -9
  186. package/kits/templates/roles/visitor.json +86 -85
  187. package/kits/templates/system-fragments/baseagent.md +14 -14
  188. package/kits/templates/system-fragments/bootstrap.md +38 -29
  189. package/kits/templates/system-fragments/channel.md +64 -64
  190. package/kits/templates/system-fragments/commands.md +28 -28
  191. package/kits/templates/system-fragments/identity.md +13 -13
  192. package/kits/templates/system-fragments/relation.md +19 -19
  193. package/kits/templates/system-fragments/session.md +59 -59
  194. package/kits/templates/system-fragments/venue.md +31 -31
  195. package/package.json +98 -98
  196. package/skills/eclink/SKILL.md +0 -84
  197. package/skills/eclink/agents/openai.yaml +0 -4
package/dist/cli/bench.js CHANGED
@@ -381,26 +381,26 @@ async function cliAuth(aid, slotId) {
381
381
  // ==================== Main Command ====================
382
382
  export async function cmdBench(args) {
383
383
  if (isHelpFlag(args[0]) || wantsHelp(args)) {
384
- console.log(`用法: ec bench [options]
385
-
386
- AUN 消息系统性能基准测试。使用多个本地 AID 并发互发消息,
387
- 测量吞吐量、延迟、丢失率,以及认证性能和账号切换性能。
388
-
389
- Options:
390
- --aids N 使用的 AID 数量 (默认 3, 范围 2-10)
391
- --rounds N 每个 AID 发送的消息轮数 (默认 20)
392
- --concurrency N 最大并发发送数 (默认 5)
393
- --wait N 发送后等待传播的秒数 (默认 3)
394
- --encrypt 发送加密消息(E2EE)
395
- --file 文件传输验证模式(压缩 evolcore 目录,拆片发送,接收后 MD5 校验+解压)
396
- --cli 使用 CLI 子进程调用(测试完整命令行链路,含进程启动开销)
397
- --aun-path <path> 自定义 AUN 目录
398
- --format json 以 JSON 输出结果
399
-
400
- 示例:
401
- ec bench --aids 5 --rounds 10
402
- ec bench --file --rounds 50
403
- ec bench --encrypt --aids 5 --rounds 20
384
+ console.log(`用法: ec bench [options]
385
+
386
+ AUN 消息系统性能基准测试。使用多个本地 AID 并发互发消息,
387
+ 测量吞吐量、延迟、丢失率,以及认证性能和账号切换性能。
388
+
389
+ Options:
390
+ --aids N 使用的 AID 数量 (默认 3, 范围 2-10)
391
+ --rounds N 每个 AID 发送的消息轮数 (默认 20)
392
+ --concurrency N 最大并发发送数 (默认 5)
393
+ --wait N 发送后等待传播的秒数 (默认 3)
394
+ --encrypt 发送加密消息(E2EE)
395
+ --file 文件传输验证模式(压缩 evolcore 目录,拆片发送,接收后 MD5 校验+解压)
396
+ --cli 使用 CLI 子进程调用(测试完整命令行链路,含进程启动开销)
397
+ --aun-path <path> 自定义 AUN 目录
398
+ --format json 以 JSON 输出结果
399
+
400
+ 示例:
401
+ ec bench --aids 5 --rounds 10
402
+ ec bench --file --rounds 50
403
+ ec bench --encrypt --aids 5 --rounds 20
404
404
  ec bench --cli --aids 3 --rounds 5`);
405
405
  return;
406
406
  }
@@ -196,26 +196,26 @@ async function runManagedBatchGet(fields, rest, formatJson) {
196
196
  }
197
197
  renderConfigExecution(response.result, formatJson);
198
198
  }
199
- const HELP = `Usage: ec config <command> [options]
200
-
201
- Fields:
202
- get <field> [<field> ...] one or more fields (batch)
203
- set <field> <value>
204
- unset <field>
205
-
206
- Scoped commands:
207
- show | effective | fields [field] | validate | init
208
-
209
- Global commands:
210
- list | snapshot | prune | history | diff | restore | current | boots
211
- schema overview of all schemas
212
- schema <name> [<version>] view a schema definition
213
- schema <name> --list list a schema's versions
214
-
215
- Selectors:
216
- --self <aid> [--peer <peerKey>] | --default | --process
217
-
218
- Output:
199
+ const HELP = `Usage: ec config <command> [options]
200
+
201
+ Fields:
202
+ get <field> [<field> ...] one or more fields (batch)
203
+ set <field> <value>
204
+ unset <field>
205
+
206
+ Scoped commands:
207
+ show | effective | fields [field] | validate | init
208
+
209
+ Global commands:
210
+ list | snapshot | prune | history | diff | restore | current | boots
211
+ schema overview of all schemas
212
+ schema <name> [<version>] view a schema definition
213
+ schema <name> --list list a schema's versions
214
+
215
+ Selectors:
216
+ --self <aid> [--peer <peerKey>] | --default | --process
217
+
218
+ Output:
219
219
  --format json`;
220
220
  export async function cmdConfig(args) {
221
221
  const subcommand = args[0];
@@ -58,15 +58,15 @@ function fail(message, code = 'INVALID_ARGUMENT', data) {
58
58
  throw error;
59
59
  }
60
60
  function printHelp() {
61
- console.log(`Usage:
62
- ec contact add <primaryId> --self <agent-aid>
63
- ec contact block <primaryId> --self <agent-aid>
64
- ec contact unblock <primaryId> --self <agent-aid>
65
- ec contact list --blocked --self <agent-aid>
66
-
67
- Options:
68
- --self <agent-aid> 必填,本端 agent AID
69
- --blocked list 必填,仅列出已拉黑联系人
70
- --format json 输出 JSON
61
+ console.log(`Usage:
62
+ ec contact add <primaryId> --self <agent-aid>
63
+ ec contact block <primaryId> --self <agent-aid>
64
+ ec contact unblock <primaryId> --self <agent-aid>
65
+ ec contact list --blocked --self <agent-aid>
66
+
67
+ Options:
68
+ --self <agent-aid> 必填,本端 agent AID
69
+ --blocked list 必填,仅列出已拉黑联系人
70
+ --format json 输出 JSON
71
71
  --help, -h 显示帮助`);
72
72
  }
@@ -3,28 +3,28 @@ import { ipcQuery } from '../ipc.js';
3
3
  import { isHelpFlag, wantsHelp } from './help.js';
4
4
  import { AGENT_DELEGATION_TOKEN_ENV } from '../core/auth/agent-delegation.js';
5
5
  // ==================== Ctl ====================
6
- const CTL_HELP = `用法: ec ctl <command> [args...]
7
-
8
- 查询:
9
- status 查看会话状态
10
- status --format json 查看当前任务的结构化运行上下文
11
- pwd 显示当前项目路径
12
- help 显示帮助
13
-
14
- 会话:
15
- name <名称> 重命名当前会话
16
-
17
- 消息:
18
- send <消息内容> 主动发送文本消息(proactive 模式)
19
- file [channel] <path> 发送项目内文件
20
- queue [--after <time>] [--before <time>] 查看/管理会话消息队列
21
-
22
- 示例:
23
- ec ctl status
24
- ec ctl status --format json
25
- ec ctl name "新会话名称"
26
- ec ctl send "任务已完成"
27
- ec ctl file report.md
6
+ const CTL_HELP = `用法: ec ctl <command> [args...]
7
+
8
+ 查询:
9
+ status 查看会话状态
10
+ status --format json 查看当前任务的结构化运行上下文
11
+ pwd 显示当前项目路径
12
+ help 显示帮助
13
+
14
+ 会话:
15
+ name <名称> 重命名当前会话
16
+
17
+ 消息:
18
+ send <消息内容> 主动发送文本消息(proactive 模式)
19
+ file [channel] <path> 发送项目内文件
20
+ queue [--after <time>] [--before <time>] 查看/管理会话消息队列
21
+
22
+ 示例:
23
+ ec ctl status
24
+ ec ctl status --format json
25
+ ec ctl name "新会话名称"
26
+ ec ctl send "任务已完成"
27
+ ec ctl file report.md
28
28
  ec ctl queue --full`;
29
29
  export async function cmdCtl(args) {
30
30
  if (args.length === 0) {
@@ -3260,21 +3260,21 @@ export async function cmdWatchCommand(args) {
3260
3260
  }
3261
3261
  else if (args[0] === 'msg') {
3262
3262
  if (isHelpFlag(args[1])) {
3263
- console.log(`用法: ec watch msg
3264
-
3265
- 三面板交互式消息监控 TUI。
3266
-
3267
- 面板:
3268
- 左 (Scope) 本地 AID 列表,显示收发统计和对端数量
3269
- 中 (Stats) 选中 AID 的对端列表(默认 All),显示 per-peer 收发数
3270
- 右 (Messages) 消息流,带滚动条
3271
-
3272
- 操作:
3273
- ↑↓ 当前面板内导航
3274
- ←→ / Tab 切换面板
3275
- Enter 选中 AID / 选中对端
3276
- Backspace 返回上一级
3277
- Page Up/Down 消息滚动
3263
+ console.log(`用法: ec watch msg
3264
+
3265
+ 三面板交互式消息监控 TUI。
3266
+
3267
+ 面板:
3268
+ 左 (Scope) 本地 AID 列表,显示收发统计和对端数量
3269
+ 中 (Stats) 选中 AID 的对端列表(默认 All),显示 per-peer 收发数
3270
+ 右 (Messages) 消息流,带滚动条
3271
+
3272
+ 操作:
3273
+ ↑↓ 当前面板内导航
3274
+ ←→ / Tab 切换面板
3275
+ Enter 选中 AID / 选中对端
3276
+ Backspace 返回上一级
3277
+ Page Up/Down 消息滚动
3278
3278
  ESC 退出`);
3279
3279
  return;
3280
3280
  }
@@ -19,73 +19,73 @@ class FsCliError extends Error {
19
19
  this.details = details;
20
20
  }
21
21
  }
22
- const HELP = `用法: ec fs <command> [args...] [options]
23
-
24
- Commands:
25
- ls <AID>:<path> 列目录
26
- stat [-L] <AID>:<path> 查看节点元数据(默认不跟随软链;-L 跟随)
27
- lstat <AID>:<path> 查看节点本身(不跟随末级软链)
28
- cat <AID>:<path> 输出文本文件内容;二进制/大文件返回头部摘要
29
- cp <local> <AID>:<path> 上传本地文件
30
- cp <AID>:<path> <local> 下载远程文件
31
- cp <AID>:<path> <AID>:<path> 远程复制(同后端)
32
- mv <AID>:<path> <AID>:<path> 移动/改名(同后端)
33
- rm [-r] <AID>:<path> 删除文件或目录
34
- mkdir [-p] <AID>:<path> 创建目录
35
- ln -s <target> <AID>:<path> 创建软链(personal storage)
36
- chmod [mode] <AID>:<path> 切换公开/私有(personal storage)
37
- setfacl <AID>:<path> -m|-x ... 设置/移除 ACL(群路径使用 role:member|role:admin)
38
- getfacl <AID>:<path> 查看 ACL
39
- token issue|revoke|ls <path> 管理访问 token(personal storage)
40
- find <AID>:<path> [filters] 查找节点
41
- df <AID>: 查看容量/配额
42
- mount <target> --volume <id> 挂载实体卷
43
- mount <target> --source <src> 挂载远程子树
44
- approve <AID>:<path> 批准待审挂载(personal storage)
45
- reject <AID>:<path> 拒绝待审挂载(personal storage)
46
- umount <AID>:<path> 卸载挂载点
47
-
48
- Options:
49
- --as <aid> 操作者 AID;也可由 EVOLCORE_SELF_AID 注入
50
- --format json 输出 JSON
51
- --overwrite, --force 覆盖目标(用于 cp/mv/ln)或强制删除(用于 rm)
52
- -r, --recursive 递归(用于 rm/cp)
53
- -p, --parents 自动创建父目录(用于 mkdir/group 上传)
54
- -L, --follow stat 跟随末级软链
55
- --token <token> 读取时携带访问 token(personal storage)
56
- --content-type <mime> 上传时指定内容类型
57
- --public 上传后公开可读(personal storage)
58
- --visibility <public|private> chmod 可见性
59
- --allow-roles <roles> chmod 角色约束,逗号分隔
60
- -m aid:<aid>:<perms> setfacl 新增/更新 ACL
61
- -x aid:<aid> setfacl 移除 ACL
62
- --source <AID>:<path> mount 虚拟卷来源
63
- --volume <id> mount 实体卷 ID
64
- --require-approval mount 需要来源 owner 审批
65
- --expires <time> mount/token/ACL 过期时间,Unix 秒或 ISO 日期
66
- --max-uses <n> ACL 最大使用次数
67
- --max-reads <n> token 最大读取次数
68
- --readonly, --readwrite mount 只读/读写
69
- --name <glob> find 名称过滤
70
- --type <f|d|l> find 类型过滤
71
- --size <expr> find 大小过滤,如 +1M
72
- --mtime <expr> find 修改时间过滤
73
- --head-bytes <n> cat 二进制头部字节数,默认 256
74
- --max-bytes <n> cat 最大直接输出字节数,默认 1048576
75
- --aun-path <path> 指定 AUN keystore 根
76
- --app <name> 指定 AUN app slot
77
-
78
- 示例:
79
- ec fs ls alice.agentid.pub:/private/
80
- ec fs cp ./report.md alice.agentid.pub:/private/report.md --as alice.agentid.pub
81
- ec fs cp alice.agentid.pub:/private/report.md ./report.md --as alice.agentid.pub
82
- ec fs cp alice.agentid.pub:/private/a.md bob.agentid.pub:/inbox/a.md --as alice.agentid.pub
83
- ec fs cat alice.agentid.pub:/private/report.md --as alice.agentid.pub
84
- ec fs ln -s alice.agentid.pub:/private/report.md alice.agentid.pub:/public/report.md --as alice.agentid.pub
85
- ec fs chmod +r alice.agentid.pub:/public/report.md --as alice.agentid.pub
86
- ec fs setfacl alice.agentid.pub:/private/report.md -m aid:bob.agentid.pub:r --as alice.agentid.pub
87
- ec fs token issue alice.agentid.pub:/public/report.md --expires 2026-12-31 --as alice.agentid.pub
88
- ec fs find alice.agentid.pub:/private/ --name "*.md" --as alice.agentid.pub
22
+ const HELP = `用法: ec fs <command> [args...] [options]
23
+
24
+ Commands:
25
+ ls <AID>:<path> 列目录
26
+ stat [-L] <AID>:<path> 查看节点元数据(默认不跟随软链;-L 跟随)
27
+ lstat <AID>:<path> 查看节点本身(不跟随末级软链)
28
+ cat <AID>:<path> 输出文本文件内容;二进制/大文件返回头部摘要
29
+ cp <local> <AID>:<path> 上传本地文件
30
+ cp <AID>:<path> <local> 下载远程文件
31
+ cp <AID>:<path> <AID>:<path> 远程复制(同后端)
32
+ mv <AID>:<path> <AID>:<path> 移动/改名(同后端)
33
+ rm [-r] <AID>:<path> 删除文件或目录
34
+ mkdir [-p] <AID>:<path> 创建目录
35
+ ln -s <target> <AID>:<path> 创建软链(personal storage)
36
+ chmod [mode] <AID>:<path> 切换公开/私有(personal storage)
37
+ setfacl <AID>:<path> -m|-x ... 设置/移除 ACL(群路径使用 role:member|role:admin)
38
+ getfacl <AID>:<path> 查看 ACL
39
+ token issue|revoke|ls <path> 管理访问 token(personal storage)
40
+ find <AID>:<path> [filters] 查找节点
41
+ df <AID>: 查看容量/配额
42
+ mount <target> --volume <id> 挂载实体卷
43
+ mount <target> --source <src> 挂载远程子树
44
+ approve <AID>:<path> 批准待审挂载(personal storage)
45
+ reject <AID>:<path> 拒绝待审挂载(personal storage)
46
+ umount <AID>:<path> 卸载挂载点
47
+
48
+ Options:
49
+ --as <aid> 操作者 AID;也可由 EVOLCORE_SELF_AID 注入
50
+ --format json 输出 JSON
51
+ --overwrite, --force 覆盖目标(用于 cp/mv/ln)或强制删除(用于 rm)
52
+ -r, --recursive 递归(用于 rm/cp)
53
+ -p, --parents 自动创建父目录(用于 mkdir/group 上传)
54
+ -L, --follow stat 跟随末级软链
55
+ --token <token> 读取时携带访问 token(personal storage)
56
+ --content-type <mime> 上传时指定内容类型
57
+ --public 上传后公开可读(personal storage)
58
+ --visibility <public|private> chmod 可见性
59
+ --allow-roles <roles> chmod 角色约束,逗号分隔
60
+ -m aid:<aid>:<perms> setfacl 新增/更新 ACL
61
+ -x aid:<aid> setfacl 移除 ACL
62
+ --source <AID>:<path> mount 虚拟卷来源
63
+ --volume <id> mount 实体卷 ID
64
+ --require-approval mount 需要来源 owner 审批
65
+ --expires <time> mount/token/ACL 过期时间,Unix 秒或 ISO 日期
66
+ --max-uses <n> ACL 最大使用次数
67
+ --max-reads <n> token 最大读取次数
68
+ --readonly, --readwrite mount 只读/读写
69
+ --name <glob> find 名称过滤
70
+ --type <f|d|l> find 类型过滤
71
+ --size <expr> find 大小过滤,如 +1M
72
+ --mtime <expr> find 修改时间过滤
73
+ --head-bytes <n> cat 二进制头部字节数,默认 256
74
+ --max-bytes <n> cat 最大直接输出字节数,默认 1048576
75
+ --aun-path <path> 指定 AUN keystore 根
76
+ --app <name> 指定 AUN app slot
77
+
78
+ 示例:
79
+ ec fs ls alice.agentid.pub:/private/
80
+ ec fs cp ./report.md alice.agentid.pub:/private/report.md --as alice.agentid.pub
81
+ ec fs cp alice.agentid.pub:/private/report.md ./report.md --as alice.agentid.pub
82
+ ec fs cp alice.agentid.pub:/private/a.md bob.agentid.pub:/inbox/a.md --as alice.agentid.pub
83
+ ec fs cat alice.agentid.pub:/private/report.md --as alice.agentid.pub
84
+ ec fs ln -s alice.agentid.pub:/private/report.md alice.agentid.pub:/public/report.md --as alice.agentid.pub
85
+ ec fs chmod +r alice.agentid.pub:/public/report.md --as alice.agentid.pub
86
+ ec fs setfacl alice.agentid.pub:/private/report.md -m aid:bob.agentid.pub:r --as alice.agentid.pub
87
+ ec fs token issue alice.agentid.pub:/public/report.md --expires 2026-12-31 --as alice.agentid.pub
88
+ ec fs find alice.agentid.pub:/private/ --name "*.md" --as alice.agentid.pub
89
89
  ec fs df alice.agentid.pub: --as alice.agentid.pub`;
90
90
  const VALUE_FLAGS = new Set([
91
91
  '--as',
@@ -153,13 +153,13 @@ function formatTimestamp(value) {
153
153
  export async function cmdHandoff(args) {
154
154
  const sub = args[0];
155
155
  if (!sub || isHelpFlag(sub) || wantsHelp(args)) {
156
- console.log(`用法: ec handoff <command> [args]
157
-
158
- Commands:
159
- return [handoff-id] [content] 确认完成;required 策略需提供回流内容
160
- return [handoff-id] --text-from-file <path>
161
- status <handoff-id> 查询 handoff 状态
162
- list [--state <state>] [--session <id>] [--limit <n>] [--agent <aid>]
156
+ console.log(`用法: ec handoff <command> [args]
157
+
158
+ Commands:
159
+ return [handoff-id] [content] 确认完成;required 策略需提供回流内容
160
+ return [handoff-id] --text-from-file <path>
161
+ status <handoff-id> 查询 handoff 状态
162
+ list [--state <state>] [--session <id>] [--limit <n>] [--agent <aid>]
163
163
  trace <handoff-id> [--limit <n>] [--agent <aid>]`);
164
164
  return;
165
165
  }
package/dist/cli/index.js CHANGED
@@ -19,57 +19,57 @@ import { cmdStart, cmdStop, cmdRestart, cmdStatus, cmdLogs, cmdWatchCommand, cmd
19
19
  import { logCliCommand } from './command-log.js';
20
20
  import { isInitCancelledError, printInitCancelHint } from './init-cancel.js';
21
21
  import { assertManagedTopLevelCommandAllowed, ManagedCommandNotAllowedError } from './managed-command-guard.js';
22
- const MAIN_HELP = `用法: ec <command> [选项]
23
-
24
- 服务:
25
- init 初始化默认配置、owner、控制 AID 与 EC Web
26
- start 启动服务
27
- stop 停止服务
28
- restart 重启服务并检查更新
29
- status 查看运行状态
30
- logs 持续查看 daemon 日志
31
- watch 打开日志、AID、消息或 EC Web 监控
32
-
33
- Agent 与会话:
34
- agent 管理 EvolAgent
35
- ctl 当前托管会话的控制命令
36
- queue 查询或操作 agent 消息队列
37
- trigger 管理定时与事件触发器
38
- handoff 查询和完成跨会话回流
39
- model 查看或设置模型与推理强度
40
- response 查看或设置响应模式
41
-
42
- AUN:
43
- aid 管理 AID 身份与 agent.md
44
- msg 私聊消息收发、撤回、在线状态与历史
45
- group 群消息与群管理
46
- fs AUN 文件系统
47
- storage 底层对象存储命令
48
- rpc 调用底层 AUN RPC
49
- menu-client 向远程 daemon 发送标准 Menu 请求
50
- contact 联系人黑名单管理
51
- net AUN 网络链路诊断
52
-
53
- 配置与诊断:
54
- config 读取、修改和检查分层配置
55
- stats Token 用量与费用统计
56
- diagnose 检查启动环境
57
- version 显示组件版本
58
- mv 迁移项目目录和会话路径
59
-
60
- 维护命令:
61
- data migrate 迁移 per-Agent 用户数据(显式维护窗口)
62
- mode 切换开发源码与 npm 包运行模式
63
- restart-monitor 运行 daemon 重启监控器
64
- bench AUN 消息性能基准测试
65
- link-rules 连接 ECK rules 到项目目录
66
-
67
- 运行 ec <command> --help 查看该命令的完整参数。
68
-
69
- 环境变量:
70
- EVOLCORE_HOME 数据目录(默认: ~/.evolcore)
71
- LOG_LEVEL 日志级别(默认: INFO)
72
- MESSAGE_LOG 消息日志(默认: true)
22
+ const MAIN_HELP = `用法: ec <command> [选项]
23
+
24
+ 服务:
25
+ init 初始化默认配置、owner、控制 AID 与 EC Web
26
+ start 启动服务
27
+ stop 停止服务
28
+ restart 重启服务并检查更新
29
+ status 查看运行状态
30
+ logs 持续查看 daemon 日志
31
+ watch 打开日志、AID、消息或 EC Web 监控
32
+
33
+ Agent 与会话:
34
+ agent 管理 EvolAgent
35
+ ctl 当前托管会话的控制命令
36
+ queue 查询或操作 agent 消息队列
37
+ trigger 管理定时与事件触发器
38
+ handoff 查询和完成跨会话回流
39
+ model 查看或设置模型与推理强度
40
+ response 查看或设置响应模式
41
+
42
+ AUN:
43
+ aid 管理 AID 身份与 agent.md
44
+ msg 私聊消息收发、撤回、在线状态与历史
45
+ group 群消息与群管理
46
+ fs AUN 文件系统
47
+ storage 底层对象存储命令
48
+ rpc 调用底层 AUN RPC
49
+ menu-client 向远程 daemon 发送标准 Menu 请求
50
+ contact 联系人黑名单管理
51
+ net AUN 网络链路诊断
52
+
53
+ 配置与诊断:
54
+ config 读取、修改和检查分层配置
55
+ stats Token 用量与费用统计
56
+ diagnose 检查启动环境
57
+ version 显示组件版本
58
+ mv 迁移项目目录和会话路径
59
+
60
+ 维护命令:
61
+ data migrate 迁移 per-Agent 用户数据(显式维护窗口)
62
+ mode 切换开发源码与 npm 包运行模式
63
+ restart-monitor 运行 daemon 重启监控器
64
+ bench AUN 消息性能基准测试
65
+ link-rules 连接 ECK rules 到项目目录
66
+
67
+ 运行 ec <command> --help 查看该命令的完整参数。
68
+
69
+ 环境变量:
70
+ EVOLCORE_HOME 数据目录(默认: ~/.evolcore)
71
+ LOG_LEVEL 日志级别(默认: INFO)
72
+ MESSAGE_LOG 消息日志(默认: true)
73
73
  EVENT_LOG 事件日志(默认: true)`;
74
74
  function printLifecycleHelp(command) {
75
75
  const help = {
@@ -115,32 +115,32 @@ export async function main(args) {
115
115
  case 'init': {
116
116
  try {
117
117
  if (wantsHelp(args.slice(1))) {
118
- console.log(`用法: ec init [渠道] [选项]
119
-
120
- 仅初始化 defaults.json:
121
- ec init 交互式(写完 defaults.json 后嵌套 agent new)
122
- 选择 ecagent 时会继续询问 API Key 和 Base URL
123
- ec init --non-interactive [选项]
124
- --baseagent <claude|codex|gemini|ecagent> 默认: PATH 中第一个可用项;ecagent 需显式选择
125
- --force 已存在 defaults.json 时覆盖
126
-
127
- 云部署非交互式初始化(结构化 JSON 输出):
128
- ec init --non-interactive --owner <aid> [--format json] [选项]
129
- --owner <aid> 必填。唯一 daemon owner AID
130
- --baseagent <claude|codex|gemini|ecagent> 可选。默认从 PATH 检测,ecagent 需显式选择
131
- --projectpath <abs-path> 可选。默认项目目录(必须绝对路径,自动创建)
132
- --ecweb 可选。安装 EC Web 并启用自启动
133
- --auto-start Windows/macOS 上启用 EvolCore 登录自启动
134
- --no-auto-start Windows/macOS 上禁用 EvolCore 登录自启动
135
- --format json 可选但推荐。stdout 输出 init.result JSON
136
- --force 已有不同 owner 时强制覆盖
137
-
138
- 配置渠道(先 ec agent new 创建 agent):
139
- ec init aun AUN owner 追加绑定(daemon 或指定 agent)
140
- ec init feishu 飞书扫码登录
141
- ec init wechat 微信扫码登录
142
- ec init dingtalk 钉钉扫码登录
143
- ec init qqbot QQ 机器人扫码绑定
118
+ console.log(`用法: ec init [渠道] [选项]
119
+
120
+ 仅初始化 defaults.json:
121
+ ec init 交互式(写完 defaults.json 后嵌套 agent new)
122
+ 选择 ecagent 时会继续询问 API Key 和 Base URL
123
+ ec init --non-interactive [选项]
124
+ --baseagent <claude|codex|gemini|ecagent> 默认: PATH 中第一个可用项;ecagent 需显式选择
125
+ --force 已存在 defaults.json 时覆盖
126
+
127
+ 云部署非交互式初始化(结构化 JSON 输出):
128
+ ec init --non-interactive --owner <aid> [--format json] [选项]
129
+ --owner <aid> 必填。唯一 daemon owner AID
130
+ --baseagent <claude|codex|gemini|ecagent> 可选。默认从 PATH 检测,ecagent 需显式选择
131
+ --projectpath <abs-path> 可选。默认项目目录(必须绝对路径,自动创建)
132
+ --ecweb 可选。安装 EC Web 并启用自启动
133
+ --auto-start Windows/macOS 上启用 EvolCore 登录自启动
134
+ --no-auto-start Windows/macOS 上禁用 EvolCore 登录自启动
135
+ --format json 可选但推荐。stdout 输出 init.result JSON
136
+ --force 已有不同 owner 时强制覆盖
137
+
138
+ 配置渠道(先 ec agent new 创建 agent):
139
+ ec init aun AUN owner 追加绑定(daemon 或指定 agent)
140
+ ec init feishu 飞书扫码登录
141
+ ec init wechat 微信扫码登录
142
+ ec init dingtalk 钉钉扫码登录
143
+ ec init qqbot QQ 机器人扫码绑定
144
144
  ec init wecom 企业微信 AI Bot 扫码创建/手工配置`);
145
145
  }
146
146
  else {
@@ -79,27 +79,27 @@ function cleanEmptyParents(dir) {
79
79
  }
80
80
  // ── 子命令 ──
81
81
  function showHelp() {
82
- console.log(`Usage: ec link-rules <subcommand> [baseagent] [--dir <path>]
83
-
84
- Subcommands:
85
- connect Connect ECK rules to a project directory (default: cwd)
86
- disconnect Remove ECK rules connection for a baseagent
87
- status Show connection state for all baseagents
88
-
89
- Arguments:
90
- baseagent Target base agent: ${KNOWN_BASEAGENTS.join(', ')} (default: cc)
91
- --dir <path> Target directory (default: current working directory)
92
-
93
- Supported baseagents:
94
- cc Claude Code (.claude/rules/eck/)
95
- codex Codex (.codex/rules/eck/)
96
- gemini Gemini CLI (.gemini/rules/eck/)
97
-
98
- Examples:
99
- ec link-rules connect # connect cc in cwd
100
- ec link-rules connect codex # connect codex in cwd
101
- ec link-rules connect cc --dir /x # connect cc in specific dir
102
- ec link-rules disconnect cc # disconnect cc
82
+ console.log(`Usage: ec link-rules <subcommand> [baseagent] [--dir <path>]
83
+
84
+ Subcommands:
85
+ connect Connect ECK rules to a project directory (default: cwd)
86
+ disconnect Remove ECK rules connection for a baseagent
87
+ status Show connection state for all baseagents
88
+
89
+ Arguments:
90
+ baseagent Target base agent: ${KNOWN_BASEAGENTS.join(', ')} (default: cc)
91
+ --dir <path> Target directory (default: current working directory)
92
+
93
+ Supported baseagents:
94
+ cc Claude Code (.claude/rules/eck/)
95
+ codex Codex (.codex/rules/eck/)
96
+ gemini Gemini CLI (.gemini/rules/eck/)
97
+
98
+ Examples:
99
+ ec link-rules connect # connect cc in cwd
100
+ ec link-rules connect codex # connect codex in cwd
101
+ ec link-rules connect cc --dir /x # connect cc in specific dir
102
+ ec link-rules disconnect cc # disconnect cc
103
103
  ec link-rules status # show all connections`);
104
104
  }
105
105
  function showStatus() {
@@ -56,17 +56,17 @@ function validateOptions(args) {
56
56
  }
57
57
  export async function cmdMenuClient(args) {
58
58
  if (wantsHelp(args)) {
59
- console.log(`用法: ec menu-client request <from-aid> <daemon-aid> [选项]
60
-
61
- --request-file <path> 从 JSON 文件读取一个 menu.* 请求
62
- --request-json <json> 直接传入一个 menu.* JSON 请求
63
- --timeout <时长> 默认 15s,最大 120s
64
- --encrypt 使用 E2EE(默认)
65
- --no-encrypt 已拒绝:ec-menu-client 必须使用 E2EE
66
- --remote-token <token> 使用 daemon 远程访问 token 临时授权
67
- --ecweb-token <token> --remote-token 的兼容别名
68
- --app <slot> 覆盖默认 evolcore-menu-client 消费槽位
69
- --aun-path <path> 覆盖本地 AUN keystore 根目录
59
+ console.log(`用法: ec menu-client request <from-aid> <daemon-aid> [选项]
60
+
61
+ --request-file <path> 从 JSON 文件读取一个 menu.* 请求
62
+ --request-json <json> 直接传入一个 menu.* JSON 请求
63
+ --timeout <时长> 默认 15s,最大 120s
64
+ --encrypt 使用 E2EE(默认)
65
+ --no-encrypt 已拒绝:ec-menu-client 必须使用 E2EE
66
+ --remote-token <token> 使用 daemon 远程访问 token 临时授权
67
+ --ecweb-token <token> --remote-token 的兼容别名
68
+ --app <slot> 覆盖默认 evolcore-menu-client 消费槽位
69
+ --aun-path <path> 覆盖本地 AUN keystore 根目录
70
70
  --format json 输出标准 menu.response JSON`);
71
71
  return;
72
72
  }