evolcore 0.0.25 → 0.0.26

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 (231) hide show
  1. package/CHANGELOG.md +607 -565
  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 +40 -29
  8. package/bin/install-codex-managed-hooks.mjs +582 -555
  9. package/dist/agents/baseagent.js +96 -46
  10. package/dist/agents/claude-runner.js +50 -12
  11. package/dist/agents/codex/app-server-client.js +13 -5
  12. package/dist/agents/codex/catalog.js +1 -1
  13. package/dist/agents/codex/diagnostics.js +34 -1
  14. package/dist/agents/codex-runner.js +121 -38
  15. package/dist/agents/ecagent-runner.js +4 -9
  16. package/dist/agents/gemini-runner.js +2 -7
  17. package/dist/agents/runner-types.js +25 -17
  18. package/dist/aun/aid/agentmd.js +81 -8
  19. package/dist/aun/aid/client.js +1 -1
  20. package/dist/aun/aid/identity.js +1 -1
  21. package/dist/aun/aid/index.js +1 -1
  22. package/dist/aun/aid/store.js +17 -13
  23. package/dist/aun/menu-client.js +74 -0
  24. package/dist/aun/msg/group.js +1 -1
  25. package/dist/aun/msg/managed-operation.js +1 -1
  26. package/dist/aun/msg/p2p.js +6 -1
  27. package/dist/aun/msg/upload.js +30 -22
  28. package/dist/channels/aun.js +329 -94
  29. package/dist/cli/agent-command.js +105 -84
  30. package/dist/cli/agent-create.js +112 -10
  31. package/dist/cli/agent.js +16 -5
  32. package/dist/cli/aun-commands.js +297 -296
  33. package/dist/cli/bench.js +20 -20
  34. package/dist/cli/config.js +47 -28
  35. package/dist/cli/contact.js +70 -13
  36. package/dist/cli/ctl-command.js +22 -22
  37. package/dist/cli/daemon-commands.js +105 -40
  38. package/dist/cli/diag.js +31 -0
  39. package/dist/cli/fs-command.js +67 -67
  40. package/dist/cli/handoff-command.js +41 -9
  41. package/dist/cli/index.js +83 -77
  42. package/dist/cli/link-rules.js +21 -21
  43. package/dist/cli/managed-command-guard.js +3 -0
  44. package/dist/cli/menu-client.js +46 -31
  45. package/dist/cli/net-check.js +22 -22
  46. package/dist/cli/queue-command.js +29 -29
  47. package/dist/cli/response.js +30 -30
  48. package/dist/cli/restart-monitor.js +87 -40
  49. package/dist/cli/stats.js +51 -51
  50. package/dist/cli/trigger-command.js +56 -56
  51. package/dist/config/builtin-roles.js +1 -0
  52. package/dist/config/config-operation-service.js +145 -0
  53. package/dist/config/contact-operation-service.js +96 -7
  54. package/dist/config/resolved-config-op.js +27 -7
  55. package/dist/core/agent-application-service.js +2 -1
  56. package/dist/core/auth/authorization-audit.js +20 -12
  57. package/dist/core/auth/operation-authorizer.js +25 -4
  58. package/dist/core/auth/operation-catalog.js +35 -4
  59. package/dist/core/auth/remote-access-store.js +40 -1
  60. package/dist/core/bootstrap-service.js +1 -1
  61. package/dist/core/command/command-handler.js +83 -26
  62. package/dist/core/command/diag-service.js +118 -0
  63. package/dist/core/command/menu-catalog.js +12 -3
  64. package/dist/core/command/menu-handler.js +47 -26
  65. package/dist/core/command/menu-protocol.js +5 -0
  66. package/dist/core/command/menu-token-store.js +41 -8
  67. package/dist/core/command/slash-gate.js +34 -4
  68. package/dist/core/command/slash-handler.js +86 -21
  69. package/dist/core/handoff/runtime.js +205 -27
  70. package/dist/core/handoff/store.js +193 -4
  71. package/dist/core/message/im-renderer.js +72 -21
  72. package/dist/core/message/message-bridge.js +69 -9
  73. package/dist/core/message/message-queue.js +26 -0
  74. package/dist/core/message/message-utils.js +1 -0
  75. package/dist/core/message/response-engine.js +47 -28
  76. package/dist/core/model/catalog-service.js +79 -49
  77. package/dist/core/model/context-window-suffix.js +33 -0
  78. package/dist/core/model/model-catalog.js +1 -1
  79. package/dist/core/model/model-permission.js +12 -3
  80. package/dist/core/permission/ec-command-parser.js +51 -12
  81. package/dist/core/permission/sandbox-runtime.js +36 -14
  82. package/dist/core/permission/tool-policy.js +2 -1
  83. package/dist/index.js +280 -163
  84. package/dist/ipc.js +54 -2
  85. package/dist/response-system/engines/v1/proactive-flow.js +59 -2
  86. package/dist/stats/billing.js +41 -15
  87. package/dist/stats/db.js +159 -159
  88. package/dist/stats/eck-vars.js +9 -9
  89. package/dist/stats/price-resolver.js +28 -10
  90. package/dist/stats/query.js +139 -139
  91. package/dist/stats/role-budget.js +6 -6
  92. package/dist/stats/writer.js +51 -51
  93. package/dist/utils/cross-platform.js +30 -1
  94. package/dist/utils/error-dict.json +160 -160
  95. package/dist/utils/error-utils.js +21 -0
  96. package/dist/utils/evolcore-version.js +129 -0
  97. package/dist/utils/logger.js +3 -1
  98. package/dist/utils/macos-autostart.js +22 -22
  99. package/dist/utils/model-prices.jsonl +23 -23
  100. package/dist/utils/npm-ops.js +176 -35
  101. package/dist/utils/welcome.js +22 -22
  102. package/ecagent/LICENSE +21 -21
  103. package/ecagent/NOTICE +11 -11
  104. package/ecagent/README.md +61 -61
  105. package/ecagent/dist/harness/compaction/branch-summarization.js +30 -30
  106. package/ecagent/dist/harness/compaction/compaction.js +83 -83
  107. package/ecagent/dist/harness/messages.js +7 -7
  108. package/kits/docs/GUIDE.md +20 -20
  109. package/kits/docs/INDEX.md +66 -66
  110. package/kits/docs/aun/CHEATSHEET.md +19 -19
  111. package/kits/docs/aun/SYNC_PROTOCOL.md +15 -15
  112. package/kits/docs/channels/aun.md +56 -56
  113. package/kits/docs/channels/feishu.md +56 -56
  114. package/kits/docs/context-assembly.md +364 -364
  115. package/kits/docs/eck_templates/GUIDE.template.md +22 -22
  116. package/kits/docs/eck_templates/INDEX.template.md +28 -28
  117. package/kits/docs/eck_templates/path-registry.template.md +33 -33
  118. package/kits/docs/eck_templates/runtime.template.md +19 -19
  119. package/kits/docs/evolcore/INDEX.md +71 -71
  120. package/kits/docs/evolcore/agent-create.md +170 -165
  121. package/kits/docs/evolcore/agent.md +66 -66
  122. package/kits/docs/evolcore/aid.md +60 -60
  123. package/kits/docs/evolcore/codex-windows-sandbox.md +146 -146
  124. package/kits/docs/evolcore/config.md +202 -195
  125. package/kits/docs/evolcore/contact.md +75 -68
  126. package/kits/docs/evolcore/ctl.md +46 -46
  127. package/kits/docs/evolcore/event.md +216 -216
  128. package/kits/docs/evolcore/fs-architecture.md +1215 -1215
  129. package/kits/docs/evolcore/fs.md +110 -110
  130. package/kits/docs/evolcore/group-collaboration.md +243 -243
  131. package/kits/docs/evolcore/group-fs.md +17 -17
  132. package/kits/docs/evolcore/group-rules.md +251 -251
  133. package/kits/docs/evolcore/group.md +152 -152
  134. package/kits/docs/evolcore/menu-client.md +42 -34
  135. package/kits/docs/evolcore/model.md +50 -50
  136. package/kits/docs/evolcore/msg.md +166 -165
  137. package/kits/docs/evolcore/response.md +75 -75
  138. package/kits/docs/evolcore/rpc.md +37 -37
  139. package/kits/docs/evolcore/self-summary.md +29 -29
  140. package/kits/docs/evolcore/stats.md +83 -83
  141. package/kits/docs/evolcore/storage.md +50 -50
  142. package/kits/docs/evolcore/trigger.md +575 -575
  143. package/kits/docs/identity/AID_PROFILE_SPEC.md +26 -26
  144. package/kits/docs/identity/PATH_OPS.md +16 -16
  145. package/kits/docs/identity/ROLE_DETAIL.md +25 -25
  146. package/kits/docs/identity/identity-tools.md +26 -26
  147. package/kits/docs/path-registry.md +62 -62
  148. package/kits/docs/prompt-loading-architecture.md +269 -269
  149. package/kits/docs/venues/aun-group.md +45 -45
  150. package/kits/docs/venues/aun-private.md +10 -10
  151. package/kits/docs/venues/client-desktop.md +10 -10
  152. package/kits/docs/venues/client-mobile.md +10 -10
  153. package/kits/docs/venues/feishu-group.md +13 -13
  154. package/kits/docs/venues/feishu-private.md +9 -9
  155. package/kits/docs/venues/group.md +37 -25
  156. package/kits/docs/venues/private.md +10 -10
  157. package/kits/eck_manifest.auxiliary.json +43 -43
  158. package/kits/eck_manifest.json +190 -190
  159. package/kits/eck_message_manifest.json +74 -74
  160. package/kits/migrations/README-role-config-v4.md +32 -32
  161. package/kits/migrations/migrate-contact-book-v2.mjs +748 -748
  162. package/kits/migrations/migrate-role-config-v4.mjs +614 -614
  163. package/kits/migrations/migrate-role-config-v5.mjs +365 -365
  164. package/kits/migrations/rename-config-file.mjs +99 -99
  165. package/kits/rules/01-overview.md +162 -162
  166. package/kits/rules/02-navigation.md +96 -96
  167. package/kits/rules/03-identity.md +36 -36
  168. package/kits/rules/04-relation.md +75 -75
  169. package/kits/rules/05-venue.md +60 -60
  170. package/kits/rules/06-channel.md +63 -63
  171. package/kits/schemas/_meta.json +53 -53
  172. package/kits/schemas/agent-config.schema.1.json +177 -177
  173. package/kits/schemas/agent-config.schema.10.json +395 -395
  174. package/kits/schemas/agent-config.schema.11.json +421 -421
  175. package/kits/schemas/agent-config.schema.12.json +427 -427
  176. package/kits/schemas/agent-config.schema.2.json +239 -239
  177. package/kits/schemas/agent-config.schema.3.json +119 -119
  178. package/kits/schemas/agent-config.schema.4.json +208 -208
  179. package/kits/schemas/agent-config.schema.5.json +326 -326
  180. package/kits/schemas/agent-config.schema.6.json +322 -322
  181. package/kits/schemas/agent-config.schema.7.json +303 -303
  182. package/kits/schemas/agent-config.schema.8.json +304 -304
  183. package/kits/schemas/agent-config.schema.9.json +364 -364
  184. package/kits/schemas/contact-book.schema.1.json +36 -36
  185. package/kits/schemas/contact-book.schema.2.json +43 -43
  186. package/kits/schemas/contact-book.schema.3.json +67 -67
  187. package/kits/schemas/daemon.schema.1.json +91 -91
  188. package/kits/schemas/daemon.schema.2.json +101 -101
  189. package/kits/schemas/daemon.schema.3.json +123 -123
  190. package/kits/schemas/daemon.schema.4.json +136 -136
  191. package/kits/schemas/daemon.schema.5.json +135 -135
  192. package/kits/schemas/daemon.schema.6.json +131 -131
  193. package/kits/schemas/defaults.schema.1.json +81 -81
  194. package/kits/schemas/defaults.schema.2.json +85 -85
  195. package/kits/schemas/defaults.schema.3.json +73 -73
  196. package/kits/schemas/defaults.schema.4.json +107 -107
  197. package/kits/schemas/defaults.schema.5.json +119 -119
  198. package/kits/schemas/menu-exec-schema-commands.md +208 -208
  199. package/kits/schemas/migrations/README.md +30 -30
  200. package/kits/schemas/relation-config.schema.1.json +158 -158
  201. package/kits/schemas/relation-config.schema.2.json +73 -73
  202. package/kits/schemas/relation-config.schema.3.json +50 -50
  203. package/kits/schemas/relation-config.schema.4.json +47 -47
  204. package/kits/schemas/relation-config.schema.5.json +47 -47
  205. package/kits/schemas/relation-config.schema.6.json +46 -46
  206. package/kits/schemas/relation-config.schema.7.json +59 -59
  207. package/kits/schemas/relation-config.schema.8.json +103 -103
  208. package/kits/schemas/role-config.schema.1.json +201 -201
  209. package/kits/schemas/role-registry.schema.1.json +35 -35
  210. package/kits/schemas/single-session.schema.1.json +31 -31
  211. package/kits/schemas/single-session.schema.2.json +57 -57
  212. package/kits/schemas/single-session.schema.3.json +32 -32
  213. package/kits/templates/bootstrap-welcome.md +17 -17
  214. package/kits/templates/message-fragments/handoff-context-to-target.md +9 -9
  215. package/kits/templates/message-fragments/handoff-request-to-target.md +19 -19
  216. package/kits/templates/message-fragments/handoff-response-to-origin.md +9 -9
  217. package/kits/templates/message-fragments/inject-default.md +2 -2
  218. package/kits/templates/message-fragments/item.md +2 -2
  219. package/kits/templates/roles/admin.json +92 -92
  220. package/kits/templates/roles/member.json +96 -96
  221. package/kits/templates/roles/owner.json +9 -9
  222. package/kits/templates/roles/visitor.json +85 -85
  223. package/kits/templates/system-fragments/baseagent.md +14 -14
  224. package/kits/templates/system-fragments/bootstrap.md +31 -29
  225. package/kits/templates/system-fragments/channel.md +64 -64
  226. package/kits/templates/system-fragments/commands.md +28 -28
  227. package/kits/templates/system-fragments/identity.md +13 -13
  228. package/kits/templates/system-fragments/relation.md +19 -19
  229. package/kits/templates/system-fragments/session.md +59 -59
  230. package/kits/templates/system-fragments/venue.md +31 -31
  231. package/package.json +100 -98
@@ -1,23 +1,23 @@
1
- {"model":"claude-opus-4-8","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
2
- {"model":"claude-opus-4-7","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
3
- {"model":"claude-opus-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
4
- {"model":"claude-sonnet-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":3,"price_output":15,"price_cache_creation":3.75,"price_cache_read":0.3,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384,"supports_cache":true,"supports_vision":true}
5
- {"model":"claude-haiku-4-5-20251001","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":0.8,"price_output":4,"price_cache_creation":1,"price_cache_read":0.08,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384,"supports_cache":true,"supports_vision":false}
6
- {"model":"gpt-5.6-sol","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":12.5,"price_cache_read":1}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
7
- {"model":"gpt-5.6-terra","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":6.25,"price_cache_read":0.5}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
8
- {"model":"gpt-5.6-luna","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1,"tiers":[{"up_to_input_tokens":272000,"price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1},{"up_to_input_tokens":null,"price_input":2,"price_output":9,"price_cache_creation":2.5,"price_cache_read":0.2}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
9
- {"model":"gpt-5.5","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":0,"price_cache_read":1}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
10
- {"model":"gpt-5.4","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":0,"price_cache_read":0.5}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
11
- {"model":"gpt-5.3-codex","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1.75,"price_output":14,"price_cache_creation":0,"price_cache_read":0.175,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
12
- {"model":"deepseek-v4-pro","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8,"context_window":1000000,"max_input_tokens":950000,"max_output_tokens":8192,"supports_cache":true}
13
- {"model":"deepseek-v4-flash","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.1,"price_cache_miss":0.5,"price_output":2,"context_window":1000000,"max_input_tokens":950000,"max_output_tokens":8192,"supports_cache":true}
14
- {"model":"deepseek-v3.2","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192,"supports_cache":true}
15
- {"model":"kimi-k2.6","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
16
- {"model":"kimi-k2.5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
17
- {"model":"glm-5.1","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
18
- {"model":"glm-5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
19
- {"model":"glm-4.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
20
- {"model":"MiniMax-M2.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
21
- {"model":"claude-opus-5","effective_from":0,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
22
- {"model":"claude-sonnet-5","effective_from":0,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
23
- {"model":"claude-fable-5","effective_from":0,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
1
+ {"model":"claude-opus-4-8","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
2
+ {"model":"claude-opus-4-7","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
3
+ {"model":"claude-opus-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":15,"price_output":75,"price_cache_creation":18.75,"price_cache_read":1.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":32768,"supports_cache":true,"supports_vision":true}
4
+ {"model":"claude-sonnet-4-6","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":3,"price_output":15,"price_cache_creation":3.75,"price_cache_read":0.3,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384,"supports_cache":true,"supports_vision":true}
5
+ {"model":"claude-haiku-4-5-20251001","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":0.8,"price_output":4,"price_cache_creation":1,"price_cache_read":0.08,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384,"supports_cache":true,"supports_vision":false}
6
+ {"model":"gpt-5.6-sol","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":6.25,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":12.5,"price_cache_read":1}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
7
+ {"model":"gpt-5.6-terra","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":3.125,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":6.25,"price_cache_read":0.5}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
8
+ {"model":"gpt-5.6-luna","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1,"tiers":[{"up_to_input_tokens":272000,"price_input":1,"price_output":6,"price_cache_creation":1.25,"price_cache_read":0.1},{"up_to_input_tokens":null,"price_input":2,"price_output":9,"price_cache_creation":2.5,"price_cache_read":0.2}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
9
+ {"model":"gpt-5.5","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5,"tiers":[{"up_to_input_tokens":272000,"price_input":5,"price_output":30,"price_cache_creation":0,"price_cache_read":0.5},{"up_to_input_tokens":null,"price_input":10,"price_output":45,"price_cache_creation":0,"price_cache_read":1}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
10
+ {"model":"gpt-5.4","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25,"tiers":[{"up_to_input_tokens":272000,"price_input":2.5,"price_output":15,"price_cache_creation":0,"price_cache_read":0.25},{"up_to_input_tokens":null,"price_input":5,"price_output":22.5,"price_cache_creation":0,"price_cache_read":0.5}],"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
11
+ {"model":"gpt-5.3-codex","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":1.75,"price_output":14,"price_cache_creation":0,"price_cache_read":0.175,"context_window":200000,"max_input_tokens":180000,"max_output_tokens":16384}
12
+ {"model":"deepseek-v4-pro","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8,"context_window":1000000,"max_input_tokens":950000,"max_output_tokens":8192,"supports_cache":true}
13
+ {"model":"deepseek-v4-flash","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.1,"price_cache_miss":0.5,"price_output":2,"context_window":1000000,"max_input_tokens":950000,"max_output_tokens":8192,"supports_cache":true}
14
+ {"model":"deepseek-v3.2","effective_from":0,"billing_fn":"per_token_deepseek_v1","currency":"CNY","price_cache_hit":0.5,"price_cache_miss":2,"price_output":8,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192,"supports_cache":true}
15
+ {"model":"kimi-k2.6","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
16
+ {"model":"kimi-k2.5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":2,"price_output":8,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
17
+ {"model":"glm-5.1","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
18
+ {"model":"glm-5","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":5,"price_output":20,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
19
+ {"model":"glm-4.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
20
+ {"model":"MiniMax-M2.7","effective_from":0,"billing_fn":"per_token_v1","currency":"CNY","price_input":1,"price_output":5,"price_cache_creation":0,"price_cache_read":0,"context_window":128000,"max_input_tokens":120000,"max_output_tokens":8192}
21
+ {"model":"claude-opus-5","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":5,"price_output":25,"price_cache_creation":6.25,"price_cache_read":0.5,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
22
+ {"model":"claude-sonnet-5","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":2,"price_output":10,"price_cache_creation":2.5,"price_cache_read":0.2,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
23
+ {"model":"claude-fable-5","effective_from":0,"billing_fn":"per_token_v1","currency":"USD","price_input":10,"price_output":50,"price_cache_creation":12.5,"price_cache_read":1,"context_window":1000000,"max_input_tokens":900000,"max_output_tokens":131072,"supports_cache":true,"supports_vision":true}
@@ -8,11 +8,119 @@
8
8
  */
9
9
  import fs from 'fs';
10
10
  import path from 'path';
11
- import { execFile, execSync } from 'child_process';
11
+ import { execFile, execFileSync } from 'child_process';
12
12
  import { promisify } from 'util';
13
13
  import { getPackageRoot } from '../paths.js';
14
14
  import { isWindows } from './cross-platform.js';
15
15
  const execFileAsync = promisify(execFile);
16
+ /** The preferred public registry for update checks. */
17
+ export const DEFAULT_NPM_REGISTRY = 'https://registry.npmjs.org';
18
+ function normalizeRegistry(registry = DEFAULT_NPM_REGISTRY) {
19
+ const value = registry.trim();
20
+ return (value || DEFAULT_NPM_REGISTRY).replace(/\/+$/, '');
21
+ }
22
+ /**
23
+ * Resolve npm from the same Node installation that is running EvolCore.
24
+ * This prevents a daemon launched by one NVM installation from querying or
25
+ * mutating another installation selected by the shell's PATH.
26
+ */
27
+ function resolveNpmInvocation() {
28
+ const nodeDir = path.dirname(process.execPath);
29
+ const sibling = path.join(nodeDir, isWindows ? 'npm.cmd' : 'npm');
30
+ const cliCandidates = [
31
+ path.join(nodeDir, 'node_modules', 'npm', 'bin', 'npm-cli.js'),
32
+ ];
33
+ if (fs.existsSync(sibling)) {
34
+ try {
35
+ const target = fs.realpathSync(sibling);
36
+ if (target.endsWith('.js'))
37
+ cliCandidates.unshift(target);
38
+ }
39
+ catch { /* fall through to the known npm layouts */ }
40
+ }
41
+ const npmCli = cliCandidates.find(candidate => fs.existsSync(candidate));
42
+ if (npmCli)
43
+ return { command: process.execPath, argsPrefix: [npmCli] };
44
+ if (isWindows) {
45
+ return {
46
+ command: process.env.ComSpec || path.join(process.env.SystemRoot || 'C:\\Windows', 'System32', 'cmd.exe'),
47
+ argsPrefix: ['/c', 'npm'],
48
+ };
49
+ }
50
+ return { command: fs.existsSync(sibling) ? sibling : 'npm', argsPrefix: [] };
51
+ }
52
+ /**
53
+ * Read the effective registry from the npm belonging to the current Node.
54
+ * An empty value means npm has no explicit registry and uses the public
55
+ * default. A command failure is handled separately by using the public source
56
+ * directly, so a broken npm config cannot leave the upgrade without a retry.
57
+ */
58
+ async function resolveUpgradeRegistry(signal) {
59
+ const npm = resolveNpmInvocation();
60
+ try {
61
+ const result = await execFileAsync(npm.command, [...npm.argsPrefix, 'config', 'get', 'registry'], {
62
+ timeout: 5000,
63
+ windowsHide: isWindows,
64
+ signal,
65
+ });
66
+ const value = String(result.stdout ?? '').trim();
67
+ if (!value || value === 'undefined' || value === 'null') {
68
+ return { registry: DEFAULT_NPM_REGISTRY, useNpmCli: false };
69
+ }
70
+ return { registry: normalizeRegistry(value), useNpmCli: true };
71
+ }
72
+ catch {
73
+ return { registry: DEFAULT_NPM_REGISTRY, useNpmCli: false };
74
+ }
75
+ }
76
+ async function checkLatestVersionViaNpm(pkg, timeoutMs, signal, registry) {
77
+ const npm = resolveNpmInvocation();
78
+ try {
79
+ const result = await execFileAsync(npm.command, [
80
+ ...npm.argsPrefix,
81
+ 'view',
82
+ `${pkg}@latest`,
83
+ 'version',
84
+ '--json',
85
+ '--registry',
86
+ registry,
87
+ ], {
88
+ timeout: timeoutMs ?? 10000,
89
+ windowsHide: isWindows,
90
+ signal,
91
+ });
92
+ const raw = String(result.stdout ?? '').trim();
93
+ if (!raw)
94
+ return null;
95
+ const parsed = JSON.parse(raw);
96
+ if (typeof parsed === 'string' && parsed)
97
+ return parsed;
98
+ if (Array.isArray(parsed)) {
99
+ const latest = parsed.at(-1);
100
+ return typeof latest === 'string' && latest ? latest : null;
101
+ }
102
+ return null;
103
+ }
104
+ catch {
105
+ return null;
106
+ }
107
+ }
108
+ // Registry checks can run concurrently, but two package upgrades must never
109
+ // mutate npm's global tree at the same time. A tiny in-process queue keeps the
110
+ // fast path parallel without changing upgrade ordering or failure semantics.
111
+ let globalInstallTail = Promise.resolve();
112
+ async function withGlobalInstallLock(action) {
113
+ const previous = globalInstallTail;
114
+ let release;
115
+ globalInstallTail = new Promise(resolve => { release = resolve; });
116
+ await previous;
117
+ try {
118
+ await action();
119
+ }
120
+ finally {
121
+ release();
122
+ }
123
+ }
16
124
  // ── npm install -g (shared) ────────────────────────────────────────────────
17
125
  /**
18
126
  * Can we run sudo without a password prompt?
@@ -35,20 +143,11 @@ async function canSudoNonInteractively() {
35
143
  }
36
144
  }
37
145
  export async function npmInstallGlobal(pkg, options = {}) {
38
- let cmd;
39
- let args;
40
- // Windows: run via cmd /c to avoid shell:true deprecation warning on Node 22.
41
- // Unix: npm directly, no shell needed.
42
- if (isWindows) {
43
- cmd = process.env.ComSpec || path.join(process.env.SystemRoot || 'C:\\Windows', 'System32', 'cmd.exe');
44
- args = ['/c', 'npm', 'install', '-g', pkg];
45
- }
46
- else {
47
- cmd = 'npm';
48
- args = ['install', '-g', pkg];
49
- }
146
+ const npm = resolveNpmInvocation();
147
+ const registry = options.registry ? normalizeRegistry(options.registry) : undefined;
148
+ const npmArgs = ['install', '-g', pkg, ...(registry ? ['--registry', registry] : [])];
50
149
  try {
51
- await execFileAsync(cmd, args, {
150
+ await execFileAsync(npm.command, [...npm.argsPrefix, ...npmArgs], {
52
151
  timeout: options.timeoutMs ?? 180000,
53
152
  windowsHide: isWindows,
54
153
  signal: options.signal,
@@ -62,9 +161,10 @@ export async function npmInstallGlobal(pkg, options = {}) {
62
161
  throw new Error('权限不足。请以管理员身份运行 PowerShell 或 CMD,然后重试');
63
162
  }
64
163
  if (!await canSudoNonInteractively()) {
65
- throw new Error(`权限不足,且 sudo 需要密码(当前进程无法交互输入)。请手动执行: sudo npm install -g ${pkg}`);
164
+ const registryArg = registry ? ` --registry ${registry}` : '';
165
+ throw new Error(`权限不足,且 sudo 需要密码(当前进程无法交互输入)。请使用当前 Node 对应的 npm 手动执行: sudo npm install -g ${pkg}${registryArg}`);
66
166
  }
67
- await execFileAsync('sudo', ['-n', 'npm', 'install', '-g', pkg], {
167
+ await execFileAsync('sudo', ['-n', npm.command, ...npm.argsPrefix, ...npmArgs], {
68
168
  timeout: options.timeoutMs ?? 180000,
69
169
  windowsHide: false,
70
170
  signal: options.signal,
@@ -132,10 +232,8 @@ export function getLocalVersion() {
132
232
  */
133
233
  export function resolveGlobalPkg(pkgName) {
134
234
  try {
135
- // 命令完全静态(npm root -g,无用户输入),用 execSync 传完整命令字符串,
136
- // 避免 "args 数组 + shell:true" 组合触发 Node DeprecationWarning,且无注入风险。
137
- const npmCmd = isWindows ? 'npm.cmd' : 'npm';
138
- const globalRoot = execSync(`${npmCmd} root -g`, {
235
+ const npm = resolveNpmInvocation();
236
+ const globalRoot = execFileSync(npm.command, [...npm.argsPrefix, 'root', '-g'], {
139
237
  encoding: 'utf-8', timeout: 10000, windowsHide: true,
140
238
  }).trim();
141
239
  const pkgPath = path.join(globalRoot, ...pkgName.split('/'), 'package.json');
@@ -152,7 +250,7 @@ export function resolveGlobalPkg(pkgName) {
152
250
  * 使用 HTTP fetch 直接查 registry API,不依赖 npm CLI。
153
251
  * 超时 10 秒,失败返回 null。
154
252
  */
155
- export async function checkLatestVersion(pkg = 'evolcore', timeoutMs = 10000, signal) {
253
+ async function fetchLatestVersion(pkg = 'evolcore', timeoutMs = 10000, signal, registry = DEFAULT_NPM_REGISTRY) {
156
254
  const controller = new AbortController();
157
255
  const abort = () => controller.abort();
158
256
  if (signal?.aborted)
@@ -161,14 +259,14 @@ export async function checkLatestVersion(pkg = 'evolcore', timeoutMs = 10000, si
161
259
  signal?.addEventListener('abort', abort, { once: true });
162
260
  const timer = setTimeout(abort, timeoutMs);
163
261
  try {
164
- const res = await fetch(`https://registry.npmjs.org/${pkg}/latest`, {
262
+ const res = await fetch(`${normalizeRegistry(registry)}/${encodeURIComponent(pkg)}/latest`, {
165
263
  signal: controller.signal,
166
264
  headers: { 'Accept': 'application/json' },
167
265
  });
168
266
  if (!res.ok)
169
267
  return null;
170
268
  const data = await res.json();
171
- return data.version || null;
269
+ return typeof data.version === 'string' && data.version ? data.version : null;
172
270
  }
173
271
  catch {
174
272
  return null;
@@ -178,6 +276,31 @@ export async function checkLatestVersion(pkg = 'evolcore', timeoutMs = 10000, si
178
276
  signal?.removeEventListener('abort', abort);
179
277
  }
180
278
  }
279
+ /**
280
+ * Read the current npm registry first. If that read succeeds, npm itself is
281
+ * used for the version query so proxy/CA/auth settings are preserved. If the
282
+ * read fails, retry once against the official HTTP endpoint. The selected
283
+ * registry is returned so installation uses the same source.
284
+ */
285
+ async function checkLatestVersionWithFallback(pkg, timeoutMs, signal, explicitRegistry) {
286
+ if (explicitRegistry) {
287
+ const registry = normalizeRegistry(explicitRegistry);
288
+ const version = await fetchLatestVersion(pkg, timeoutMs, signal, registry);
289
+ return version ? { version, registry } : null;
290
+ }
291
+ const selection = await resolveUpgradeRegistry(signal);
292
+ const version = selection.useNpmCli
293
+ ? await checkLatestVersionViaNpm(pkg, timeoutMs, signal, selection.registry)
294
+ : await fetchLatestVersion(pkg, timeoutMs, signal, selection.registry);
295
+ return version ? { version, registry: selection.registry } : null;
296
+ }
297
+ /**
298
+ * Query the registry selected from the running Node/npm configuration, or the
299
+ * official registry when that configuration cannot be read.
300
+ */
301
+ export async function checkLatestVersion(pkg = 'evolcore', timeoutMs = 10000, signal, registry) {
302
+ return (await checkLatestVersionWithFallback(pkg, timeoutMs, signal, registry))?.version ?? null;
303
+ }
181
304
  /**
182
305
  * 完整升级流程:检查 → 比较 → 安装(失败重试一次)
183
306
  */
@@ -188,12 +311,13 @@ export async function tryUpgrade(options = {}) {
188
311
  }
189
312
  const localVer = getLocalVersion();
190
313
  // 查询 registry
191
- const remoteVer = await checkLatestVersion('evolcore', options.checkTimeoutMs, options.signal);
192
- if (!remoteVer) {
314
+ const checked = await checkLatestVersionWithFallback('evolcore', options.checkTimeoutMs, options.signal, options.registry);
315
+ if (!checked) {
193
316
  return options.signal?.aborted
194
317
  ? { status: 'failed', from: localVer, error: 'Upgrade cancelled or timed out' }
195
318
  : { status: 'skipped', error: 'Failed to check remote version' };
196
319
  }
320
+ const { version: remoteVer, registry } = checked;
197
321
  // 版本比较
198
322
  if (compareVersions(localVer, remoteVer) >= 0) {
199
323
  return { status: 'no-update', from: localVer };
@@ -202,11 +326,19 @@ export async function tryUpgrade(options = {}) {
202
326
  let lastError;
203
327
  for (let attempt = 0; attempt < 2; attempt++) {
204
328
  try {
205
- await npmInstallGlobal('evolcore@latest', {
206
- timeoutMs: options.installTimeoutMs,
207
- signal: options.signal,
329
+ let installedVer;
330
+ await withGlobalInstallLock(async () => {
331
+ await npmInstallGlobal(`evolcore@${remoteVer}`, {
332
+ timeoutMs: options.installTimeoutMs,
333
+ signal: options.signal,
334
+ registry,
335
+ });
336
+ installedVer = getLocalVersion();
208
337
  });
209
- return { status: 'upgraded', from: localVer, to: remoteVer };
338
+ if (!installedVer || compareVersions(installedVer, remoteVer) < 0) {
339
+ throw new Error(`npm install completed but evolcore is still ${installedVer ?? 'not installed'} (target ${remoteVer})`);
340
+ }
341
+ return { status: 'upgraded', from: localVer, to: installedVer };
210
342
  }
211
343
  catch (e) {
212
344
  lastError = e.stderr || e.message || String(e);
@@ -230,23 +362,32 @@ export async function tryUpgradeGlobalPkg(resolveInstalled, pkgName, options = {
230
362
  return { status: 'skipped' }; // not installed, skip
231
363
  }
232
364
  const localVer = installed.version;
233
- const remoteVer = await checkLatestVersion(pkgName, options.checkTimeoutMs, options.signal);
234
- if (!remoteVer) {
365
+ const checked = await checkLatestVersionWithFallback(pkgName, options.checkTimeoutMs, options.signal, options.registry);
366
+ if (!checked) {
235
367
  return options.signal?.aborted
236
368
  ? { status: 'failed', from: localVer, error: 'Upgrade cancelled or timed out' }
237
369
  : { status: 'skipped', error: 'Failed to check remote version' };
238
370
  }
371
+ const { version: remoteVer, registry } = checked;
239
372
  if (compareVersions(localVer, remoteVer) >= 0) {
240
373
  return { status: 'no-update', from: localVer };
241
374
  }
242
375
  let lastError;
243
376
  for (let attempt = 0; attempt < 2; attempt++) {
244
377
  try {
245
- await npmInstallGlobal(`${pkgName}@latest`, {
246
- timeoutMs: options.installTimeoutMs,
247
- signal: options.signal,
378
+ let installedVer;
379
+ await withGlobalInstallLock(async () => {
380
+ await npmInstallGlobal(`${pkgName}@${remoteVer}`, {
381
+ timeoutMs: options.installTimeoutMs,
382
+ signal: options.signal,
383
+ registry,
384
+ });
385
+ installedVer = resolveInstalled()?.version;
248
386
  });
249
- return { status: 'upgraded', from: localVer, to: remoteVer };
387
+ if (!installedVer || compareVersions(installedVer, remoteVer) < 0) {
388
+ throw new Error(`npm install completed but ${pkgName} is still ${installedVer ?? 'not installed'} (target ${remoteVer})`);
389
+ }
390
+ return { status: 'upgraded', from: localVer, to: installedVer };
250
391
  }
251
392
  catch (e) {
252
393
  lastError = e.stderr || e.message || String(e);
@@ -31,23 +31,23 @@ export function generateWelcomeMessage(options) {
31
31
  const bindingNote = options.includeBindingNote
32
32
  ? `\n\n🔐 **绑定说明**:\n- 这条消息表示您的设备已和此 Agent 绑定\n- 只有您能看到和使用这个 Agent\n- AUN 提供端到端加密和跨设备同步`
33
33
  : '';
34
- return `🎉 欢迎使用 EvolCore!
35
-
36
- ${greeting}
37
-
38
- ${agentIntro}${channelInfo}
39
-
40
- 📋 **日常使用方法**:
41
-
42
- 1. **查看帮助**:发送 \`/help\` 查看所有可用命令
43
- 2. **查看状态**:发送 \`/status\` 查看当前会话状态
44
- 3. **会话管理**:发送 \`/session\` 查看和切换会话
45
-
46
- 💡 **提示**:
47
- - 直接发送消息即可与 Claude/Codex 对话
48
- - 支持多会话管理,每个会话独立上下文
49
- - 所有命令以 \`/\` 开头${channelSpecificNote}${bindingNote}
50
-
34
+ return `🎉 欢迎使用 EvolCore!
35
+
36
+ ${greeting}
37
+
38
+ ${agentIntro}${channelInfo}
39
+
40
+ 📋 **日常使用方法**:
41
+
42
+ 1. **查看帮助**:发送 \`/help\` 查看所有可用命令
43
+ 2. **查看状态**:发送 \`/status\` 查看当前会话状态
44
+ 3. **会话管理**:发送 \`/session\` 查看和切换会话
45
+
46
+ 💡 **提示**:
47
+ - 直接发送消息即可与 Claude/Codex 对话
48
+ - 支持多会话管理,每个会话独立上下文
49
+ - 所有命令以 \`/\` 开头${channelSpecificNote}${bindingNote}
50
+
51
51
  现在就可以开始工作了!`;
52
52
  }
53
53
  /**
@@ -65,25 +65,25 @@ export function generateInitSuccessMessage(channelType, hasOwner) {
65
65
  const channelName = getChannelDescription(channelType);
66
66
  // AUN 在 connect 时向 owner 发送欢迎消息
67
67
  if (hasOwner && channelType === 'aun') {
68
- return `\n💡 提示:首次启动时会向 owner 发送欢迎消息
68
+ return `\n💡 提示:首次启动时会向 owner 发送欢迎消息
69
69
  启动服务: ec start`;
70
70
  }
71
71
  // Feishu 虽然有 owner,但已改为首次交互发送(与其他 IM 统一)
72
72
  if (hasOwner && channelType === 'feishu') {
73
- return `\n💡 提示:首次用户交互时会发送欢迎消息
73
+ return `\n💡 提示:首次用户交互时会发送欢迎消息
74
74
  启动服务: ec start`;
75
75
  }
76
76
  // 其他 IM 渠道:首次交互发送
77
77
  if (hasOwner) {
78
- return `\n💡 提示:${channelName}渠道已配置
78
+ return `\n💡 提示:${channelName}渠道已配置
79
79
  启动服务: ec start`;
80
80
  }
81
81
  const ownerHint = channelType === 'aun'
82
82
  ? ` 配置 owner: ec init ${channelType}`
83
83
  : ' 配置 owner: 在 agent config.json 的 owners 中写入 AID;非 AUN 渠道身份写入 contact.json';
84
84
  // 无 owner 的渠道
85
- return `\n💡 提示:${channelName}渠道已配置
86
- 启动服务: ec start
85
+ return `\n💡 提示:${channelName}渠道已配置
86
+ 启动服务: ec start
87
87
  ${ownerHint}`;
88
88
  }
89
89
  /**
package/ecagent/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Mario Zechner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mario Zechner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/ecagent/NOTICE CHANGED
@@ -1,11 +1,11 @@
1
- This distribution contains modified packaging of @earendil-works/pi-agent-core.
2
-
3
- Upstream project: https://github.com/earendil-works/pi
4
- Upstream version: 0.80.7
5
- Upstream commit: 818d67457cdd6b60bce6b121d16b23141c252dd8
6
-
7
- Modification: TypeScript sources from @earendil-works/pi-agent-core and the
8
- provider-free protocol subset of @earendil-works/pi-ai are maintained together
9
- in this package. Provider SDK implementations and dependencies are excluded.
10
- Callers supply a custom model stream function or use the included pi-messages
11
- protocol runtime.
1
+ This distribution contains modified packaging of @earendil-works/pi-agent-core.
2
+
3
+ Upstream project: https://github.com/earendil-works/pi
4
+ Upstream version: 0.80.7
5
+ Upstream commit: 818d67457cdd6b60bce6b121d16b23141c252dd8
6
+
7
+ Modification: TypeScript sources from @earendil-works/pi-agent-core and the
8
+ provider-free protocol subset of @earendil-works/pi-ai are maintained together
9
+ in this package. Provider SDK implementations and dependencies are excluded.
10
+ Callers supply a custom model stream function or use the included pi-messages
11
+ protocol runtime.
package/ecagent/README.md CHANGED
@@ -1,61 +1,61 @@
1
- # ecagent
2
-
3
- `ecagent` is an unofficial lightweight distribution of
4
- [`@earendil-works/pi-agent-core`](https://github.com/earendil-works/pi). It
5
- includes the Pi agent loop, tools, sessions, compaction, skills, and execution
6
- environment abstractions together with an embedded provider-free model runtime.
7
- The published package includes both the TypeScript source in `src/` and the
8
- compiled ESM output in `dist/`.
9
-
10
- ## Install
11
-
12
- ```bash
13
- npm install ecagent
14
-
15
- # Or install it globally for a shared Node.js runtime
16
- npm install --global ecagent
17
- ```
18
-
19
- Supply a custom model stream function. No model provider SDK is installed by
20
- default:
21
-
22
- ```typescript
23
- import { Agent } from "ecagent";
24
-
25
- const agent = new Agent({
26
- initialState: {
27
- model,
28
- systemPrompt: "You are a coding agent.",
29
- },
30
- streamFn: evolcoreModelStream,
31
- });
32
- ```
33
-
34
- The `streamFn` must implement the Pi stream contract exported by
35
- `ecagent/runtime`:
36
-
37
- ```typescript
38
- import { AssistantMessageEventStream } from "ecagent/runtime";
39
- ```
40
-
41
- EvolCore uses this boundary to connect its own credentials, gateway, streaming,
42
- and abort handling.
43
-
44
- ## Build from source
45
-
46
- ```bash
47
- npm install
48
- npm run build
49
- ```
50
-
51
- The build runs TypeScript directly over the checked-in source. It does not
52
- download precompiled upstream artifacts.
53
-
54
- ## Upstream
55
-
56
- - Package: `@earendil-works/pi-agent-core@0.80.7`
57
- - Runtime: `@earendil-works/pi-ai@0.80.7`
58
- - Commit: `818d67457cdd6b60bce6b121d16b23141c252dd8`
59
- - License: MIT
60
-
61
- This package is not affiliated with or endorsed by the Pi maintainers.
1
+ # ecagent
2
+
3
+ `ecagent` is an unofficial lightweight distribution of
4
+ [`@earendil-works/pi-agent-core`](https://github.com/earendil-works/pi). It
5
+ includes the Pi agent loop, tools, sessions, compaction, skills, and execution
6
+ environment abstractions together with an embedded provider-free model runtime.
7
+ The published package includes both the TypeScript source in `src/` and the
8
+ compiled ESM output in `dist/`.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install ecagent
14
+
15
+ # Or install it globally for a shared Node.js runtime
16
+ npm install --global ecagent
17
+ ```
18
+
19
+ Supply a custom model stream function. No model provider SDK is installed by
20
+ default:
21
+
22
+ ```typescript
23
+ import { Agent } from "ecagent";
24
+
25
+ const agent = new Agent({
26
+ initialState: {
27
+ model,
28
+ systemPrompt: "You are a coding agent.",
29
+ },
30
+ streamFn: evolcoreModelStream,
31
+ });
32
+ ```
33
+
34
+ The `streamFn` must implement the Pi stream contract exported by
35
+ `ecagent/runtime`:
36
+
37
+ ```typescript
38
+ import { AssistantMessageEventStream } from "ecagent/runtime";
39
+ ```
40
+
41
+ EvolCore uses this boundary to connect its own credentials, gateway, streaming,
42
+ and abort handling.
43
+
44
+ ## Build from source
45
+
46
+ ```bash
47
+ npm install
48
+ npm run build
49
+ ```
50
+
51
+ The build runs TypeScript directly over the checked-in source. It does not
52
+ download precompiled upstream artifacts.
53
+
54
+ ## Upstream
55
+
56
+ - Package: `@earendil-works/pi-agent-core@0.80.7`
57
+ - Runtime: `@earendil-works/pi-ai@0.80.7`
58
+ - Commit: `818d67457cdd6b60bce6b121d16b23141c252dd8`
59
+ - License: MIT
60
+
61
+ This package is not affiliated with or endorsed by the Pi maintainers.