evolclaw 3.2.0 → 3.4.0

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 (95) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +7 -4
  3. package/dist/agents/{resolve.js → baseagent.js} +34 -5
  4. package/dist/agents/claude-runner.js +120 -31
  5. package/dist/agents/codex-app-server-client.js +364 -0
  6. package/dist/agents/codex-runner.js +1152 -140
  7. package/dist/agents/gemini-runner.js +2 -2
  8. package/dist/agents/runner-types.js +58 -0
  9. package/dist/aun/aid/store.js +1 -1
  10. package/dist/aun/outbox.js +14 -2
  11. package/dist/aun/storage/download.js +1 -1
  12. package/dist/aun/storage/upload.js +13 -1
  13. package/dist/channels/aun.js +869 -358
  14. package/dist/channels/dingtalk.js +77 -140
  15. package/dist/channels/feishu.js +125 -154
  16. package/dist/channels/qqbot.js +75 -138
  17. package/dist/channels/wechat.js +75 -136
  18. package/dist/channels/wecom.js +75 -138
  19. package/dist/cli/agent-command.js +591 -0
  20. package/dist/cli/agent.js +23 -8
  21. package/dist/cli/aun-commands.js +1444 -0
  22. package/dist/cli/ctl-command.js +78 -0
  23. package/dist/cli/daemon-commands.js +2707 -0
  24. package/dist/cli/index.js +23 -4905
  25. package/dist/cli/init.js +33 -6
  26. package/dist/cli/model.js +1 -1
  27. package/dist/cli/restart-monitor.js +539 -0
  28. package/dist/cli/stats.js +558 -0
  29. package/dist/cli/version.js +87 -0
  30. package/dist/cli/watch-logs.js +33 -0
  31. package/dist/cli/watch-msg.js +5 -2
  32. package/dist/config-store.js +12 -6
  33. package/dist/core/channel-loader.js +88 -83
  34. package/dist/core/command/command-handler.js +1189 -0
  35. package/dist/core/command/menu-handler.js +1478 -0
  36. package/dist/core/command/slash-gate.js +142 -0
  37. package/dist/core/command/slash-handler.js +2090 -0
  38. package/dist/core/evolagent-registry.js +82 -0
  39. package/dist/core/evolagent.js +17 -1
  40. package/dist/core/interaction-router.js +8 -0
  41. package/dist/core/message/command-handler-agent-control.js +63 -1
  42. package/dist/core/message/im-renderer.js +91 -51
  43. package/dist/core/message/items-formatter.js +9 -1
  44. package/dist/core/message/message-bridge.js +73 -24
  45. package/dist/core/message/message-log.js +1 -0
  46. package/dist/core/message/message-processor.js +432 -94
  47. package/dist/core/message/message-queue.js +70 -2
  48. package/dist/core/message/pending-hints.js +232 -0
  49. package/dist/core/model/model-catalog.js +1 -1
  50. package/dist/core/model/model-scope.js +2 -2
  51. package/dist/core/permission.js +25 -12
  52. package/dist/core/relation/peer-identity.js +16 -1
  53. package/dist/core/session/adapters/codex-session-file-adapter.js +4 -2
  54. package/dist/core/session/session-manager.js +86 -26
  55. package/dist/core/session/session-title.js +26 -0
  56. package/dist/core/stats/billing.js +151 -0
  57. package/dist/core/stats/budget.js +93 -0
  58. package/dist/core/stats/db.js +334 -0
  59. package/dist/core/stats/eck-vars.js +84 -0
  60. package/dist/core/stats/index.js +10 -0
  61. package/dist/core/stats/normalizer.js +78 -0
  62. package/dist/core/stats/query.js +760 -0
  63. package/dist/core/stats/writer.js +115 -0
  64. package/dist/core/trigger/manager.js +34 -0
  65. package/dist/core/trigger/parser.js +9 -3
  66. package/dist/core/trigger/scheduler.js +20 -17
  67. package/dist/data/error-dict.json +7 -0
  68. package/dist/{agents → eck}/manifest-engine.js +20 -1
  69. package/dist/{agents → eck}/message-renderer.js +24 -1
  70. package/dist/index.js +174 -9
  71. package/dist/ipc.js +116 -1
  72. package/dist/utils/cross-platform.js +58 -5
  73. package/dist/utils/ecweb-launch.js +49 -0
  74. package/dist/utils/ecweb-pair.js +20 -0
  75. package/dist/utils/error-utils.js +18 -5
  76. package/dist/utils/npm-ops.js +38 -8
  77. package/dist/utils/stats.js +77 -6
  78. package/kits/docs/evolclaw/INDEX.md +3 -1
  79. package/kits/docs/evolclaw/fs-architecture.md +1215 -0
  80. package/kits/docs/evolclaw/fs.md +131 -0
  81. package/kits/docs/evolclaw/group-fs.md +209 -0
  82. package/kits/docs/evolclaw/stats.md +70 -0
  83. package/kits/docs/venues/aun-group.md +29 -6
  84. package/kits/docs/venues/group.md +5 -4
  85. package/kits/eck_message_manifest.json +30 -3
  86. package/kits/rules/05-venue.md +1 -1
  87. package/kits/templates/message-fragments/inject-default.md +2 -0
  88. package/package.json +5 -6
  89. package/dist/agents/baseagent-normalize.js +0 -19
  90. package/dist/core/command-handler.js +0 -3876
  91. package/dist/core/relation/peer-key.js +0 -16
  92. package/dist/evolclaw-config.js +0 -11
  93. package/dist/utils/channel-helpers.js +0 -46
  94. /package/dist/core/{cache/file-cache.js → daemon-file-cache.js} +0 -0
  95. /package/dist/{agents → eck}/kit-renderer.js +0 -0
@@ -1,16 +0,0 @@
1
- /**
2
- * peerKey: 关系层路由键,格式 `<channelType>#<urlEncode(channelId)>`。
3
- * 群聊场景下 channelId = groupId,所有发言者共用同一个 peerKey。
4
- */
5
- export function formatPeerKey(channelType, channelId) {
6
- return `${channelType}#${encodeURIComponent(channelId)}`;
7
- }
8
- export function parsePeerKey(key) {
9
- const idx = key.indexOf('#');
10
- if (idx <= 0)
11
- throw new Error(`Invalid peer key: ${key}`);
12
- return {
13
- channelType: key.slice(0, idx),
14
- channelId: decodeURIComponent(key.slice(idx + 1)),
15
- };
16
- }
@@ -1,11 +0,0 @@
1
- import { resolvePaths } from './paths.js';
2
- import { atomicReadJson, atomicWriteJson } from './utils/atomic-write.js';
3
- /** 读 {root}/evolclaw.json。文件不存在返回 {},不报错。 */
4
- export function loadEvolclawConfig() {
5
- const raw = atomicReadJson(resolvePaths().evolclawJson);
6
- return raw ?? {};
7
- }
8
- /** 原子写入 {root}/evolclaw.json。调用方负责传完整对象(含要保留的字段)。 */
9
- export function saveEvolclawConfig(value) {
10
- atomicWriteJson(resolvePaths().evolclawJson, value);
11
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * Channel 配置归一化工具——给 ChannelLoader 时代的 channel adapter 用。
3
- *
4
- * 旧结构里 `Config.channels.<type>` 可以是 single object 或 array;这些工具
5
- * 用来抹平这种差异。新结构(agents/<aid>/config.json)的 channels 已经统一为
6
- * 列表形态,这些工具仍被 ChannelLoader 调用方使用——index.ts 把新结构翻成旧
7
- * dict 形态喂给 ChannelLoader,所以 normalizeChannelInstances 仍然有用武之地。
8
- *
9
- * 当 ChannelLoader 重写为直接吃 ChannelInstance[] 后,本文件可删。
10
- */
11
- export const channelTypes = ['feishu', 'wechat', 'aun', 'dingtalk', 'qqbot', 'wecom'];
12
- /**
13
- * 把 channel 配置(单对象 / 数组 / undefined)归一为带 name 的数组。
14
- */
15
- export function normalizeChannelInstances(cfg, defaultName) {
16
- if (cfg === undefined || cfg === null)
17
- return [];
18
- if (Array.isArray(cfg)) {
19
- return cfg.map((item, i) => ({
20
- ...item,
21
- name: item.name ?? (cfg.length === 1 ? defaultName : `${defaultName}-${i + 1}`),
22
- }));
23
- }
24
- return [{ ...cfg, name: cfg.name ?? defaultName }];
25
- }
26
- /**
27
- * 从 globalConfig.channels 字典里按实例名找 showActivities,找不到回退到全局。
28
- */
29
- export function getChannelShowActivities(config, instanceName) {
30
- for (const type of channelTypes) {
31
- const raw = config.channels?.[type];
32
- if (raw === undefined)
33
- continue;
34
- if (Array.isArray(raw)) {
35
- const inst = raw.find((item) => item.name === instanceName);
36
- if (inst)
37
- return inst.showActivities ?? config.showActivities ?? 'all';
38
- }
39
- else {
40
- const effectiveName = raw.name ?? type;
41
- if (effectiveName === instanceName)
42
- return raw.showActivities ?? config.showActivities ?? 'all';
43
- }
44
- }
45
- return config.showActivities ?? 'all';
46
- }
File without changes