evolclaw 3.3.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.
- package/CHANGELOG.md +36 -0
- package/README.md +7 -3
- package/dist/agents/claude-runner.js +23 -27
- package/dist/agents/codex-runner.js +90 -6
- package/dist/agents/runner-types.js +30 -0
- package/dist/aun/outbox.js +14 -2
- package/dist/channels/aun.js +506 -108
- package/dist/channels/feishu.js +29 -5
- package/dist/cli/agent-command.js +591 -0
- package/dist/cli/agent.js +15 -3
- package/dist/cli/aun-commands.js +1444 -0
- package/dist/cli/ctl-command.js +78 -0
- package/dist/cli/daemon-commands.js +2707 -0
- package/dist/cli/index.js +12 -5027
- package/dist/cli/restart-monitor.js +539 -0
- package/dist/cli/watch-logs.js +33 -0
- package/dist/core/channel-loader.js +4 -1
- package/dist/core/command/command-handler.js +1189 -0
- package/dist/core/command/menu-handler.js +1478 -0
- package/dist/core/command/slash-gate.js +142 -0
- package/dist/core/command/slash-handler.js +2090 -0
- package/dist/core/evolagent-registry.js +81 -0
- package/dist/core/evolagent.js +16 -0
- package/dist/core/message/im-renderer.js +67 -49
- package/dist/core/message/message-bridge.js +30 -9
- package/dist/core/message/message-processor.js +200 -122
- package/dist/core/message/message-queue.js +68 -0
- package/dist/core/permission.js +16 -0
- package/dist/core/session/session-manager.js +59 -13
- package/dist/core/stats/db.js +20 -0
- package/dist/core/stats/writer.js +3 -3
- package/dist/data/error-dict.json +7 -0
- package/dist/index.js +49 -6
- package/dist/ipc.js +99 -0
- package/dist/utils/cross-platform.js +35 -0
- package/dist/utils/ecweb-launch.js +49 -0
- package/dist/utils/error-utils.js +18 -5
- package/dist/utils/npm-ops.js +38 -8
- package/dist/utils/stats.js +63 -6
- package/kits/eck_manifest.json +0 -12
- package/package.json +2 -3
- package/dist/core/command-handler.js +0 -4235
- package/dist/core/message/response-depth.js +0 -56
- package/kits/templates/system-fragments/response-depth.md +0 -16
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
/**
|
|
3
|
-
* 计算消息内容的话题指纹(前 20 字符的 md5 前 8 位)。
|
|
4
|
-
*/
|
|
5
|
-
export function computeTopicHash(content) {
|
|
6
|
-
const slice = content.trim().slice(0, 20);
|
|
7
|
-
return crypto.createHash('md5').update(slice).digest('hex').slice(0, 8);
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* 群聊响应深度决策(纯函数,无 I/O)。
|
|
11
|
-
*
|
|
12
|
-
* 根据 dispatch 模式、消息特征(长度/是否问句/是否被@)、话题轮次综合判断。
|
|
13
|
-
* 返回 depth 枚举 + 更新后的话题追踪状态(调用方负责持久化)。
|
|
14
|
-
*/
|
|
15
|
-
export function resolveResponseDepth(input) {
|
|
16
|
-
const { chatType, content, selfAid, mentionAids, dispatch, topicRounds: prevRounds, lastTopicHash } = input;
|
|
17
|
-
// 仅群聊走深度决策;私聊一律 standard
|
|
18
|
-
if (chatType !== 'group') {
|
|
19
|
-
return { depth: 'standard', topicRounds: prevRounds, topicHash: lastTopicHash || '' };
|
|
20
|
-
}
|
|
21
|
-
const trimmed = content.trim();
|
|
22
|
-
// ── 话题追踪:更新 topicRounds ──
|
|
23
|
-
const topicHash = computeTopicHash(trimmed);
|
|
24
|
-
let topicRounds;
|
|
25
|
-
if (lastTopicHash && lastTopicHash === topicHash) {
|
|
26
|
-
topicRounds = prevRounds + 1;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
topicRounds = 1;
|
|
30
|
-
}
|
|
31
|
-
// ── 判断因子 ──
|
|
32
|
-
const isMentioned = !!(selfAid && mentionAids?.includes(selfAid));
|
|
33
|
-
const isQuestion = /[??]\s*$/.test(trimmed) || /^(what|how|why|when|where|who|which|请问|怎么|为什么|什么|如何|能不能|可以)/i.test(trimmed);
|
|
34
|
-
const isShort = trimmed.length <= 30;
|
|
35
|
-
// ── 决策逻辑 ──
|
|
36
|
-
// 被@:至少 standard;话题深入则升 deep
|
|
37
|
-
if (isMentioned) {
|
|
38
|
-
const depth = topicRounds >= 3 ? 'deep' : 'standard';
|
|
39
|
-
return { depth, topicRounds, topicHash };
|
|
40
|
-
}
|
|
41
|
-
// broadcast 模式:短消息 + 非问句 → lightweight
|
|
42
|
-
if (dispatch === 'broadcast') {
|
|
43
|
-
let depth;
|
|
44
|
-
if (topicRounds >= 3)
|
|
45
|
-
depth = 'deep';
|
|
46
|
-
else if (isShort && !isQuestion)
|
|
47
|
-
depth = 'lightweight';
|
|
48
|
-
else
|
|
49
|
-
depth = 'standard';
|
|
50
|
-
return { depth, topicRounds, topicHash };
|
|
51
|
-
}
|
|
52
|
-
// mention 模式下到达这里说明已通过 dispatch 过滤(被@才入队),
|
|
53
|
-
// 等同于 isMentioned === true 的分支。兜底 standard。
|
|
54
|
-
const depth = topicRounds >= 3 ? 'deep' : 'standard';
|
|
55
|
-
return { depth, topicRounds, topicHash };
|
|
56
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{{?responseDepth=lightweight}}
|
|
2
|
-
[response-depth: lightweight]
|
|
3
|
-
本条消息判定为轻量互动。回复约束:
|
|
4
|
-
- 一两句话,不超过 50 字
|
|
5
|
-
- 可以是附和、简短观点、表情回应
|
|
6
|
-
- 不要展开分析、不要列举、不要追问
|
|
7
|
-
- 如果对方需要深入讨论,他们会追问或 @ 你
|
|
8
|
-
{{/}}
|
|
9
|
-
{{?responseDepth=deep}}
|
|
10
|
-
[response-depth: deep]
|
|
11
|
-
本话题已持续多轮,判定为深度讨论。你可以:
|
|
12
|
-
- 展开完整分析,给出结构化观点
|
|
13
|
-
- 引用前文上下文做对比或补充
|
|
14
|
-
- 主动提出新角度或反问
|
|
15
|
-
- 长度不受限——把事情说透比简短更重要
|
|
16
|
-
{{/}}
|