chatccc 0.2.294 → 0.2.296
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.
|
@@ -56,6 +56,9 @@ const TOOL_EMOJI_MAP = {
|
|
|
56
56
|
delete_file: "\u{1F5D1}\u{FE0F}", // 🗑️
|
|
57
57
|
move_file: "\u{1F4E6}", // 📦
|
|
58
58
|
apply_patch: "\u{1F4CB}", // 📋
|
|
59
|
+
task: "\u{1F916}", // 🤖
|
|
60
|
+
task_output: "\u{1F916}", // 🤖
|
|
61
|
+
task_stop: "\u{1F916}", // 🤖
|
|
59
62
|
};
|
|
60
63
|
export function getToolEmoji(name) {
|
|
61
64
|
return TOOL_EMOJI_MAP[name] ?? TOOL_EMOJI_MAP[normalizeToolName(name)] ?? "\u{1F527}"; // 🔧
|
|
@@ -9,6 +9,8 @@ export const WEB_TOOL_SUMMARY_RULES = {
|
|
|
9
9
|
move_file: { emoji: "📦", inputFields: ["sourcePath", "destinationPath"] },
|
|
10
10
|
apply_patch: { emoji: "📋", inputFields: [] },
|
|
11
11
|
task: { emoji: "🤖", inputFields: ["description", "cwd"] },
|
|
12
|
+
task_output: { emoji: "🤖", inputFields: ["taskId"] },
|
|
13
|
+
task_stop: { emoji: "🤖", inputFields: ["taskId"] },
|
|
12
14
|
websearch: { emoji: "🌐", inputFields: ["query"] },
|
|
13
15
|
webfetch: { emoji: "📥", inputFields: ["url"] },
|
|
14
16
|
session_search: { emoji: "🗂️", inputFields: ["query", "session_id"] },
|
package/dist/src/cards.js
CHANGED
|
@@ -67,6 +67,9 @@ const TOOL_EMOJI_MAP = {
|
|
|
67
67
|
delete_file: "\u{1F5D1}\u{FE0F}", // 🗑️
|
|
68
68
|
move_file: "\u{1F4E6}", // 📦
|
|
69
69
|
apply_patch: "\u{1F4CB}", // 📋
|
|
70
|
+
task: "\u{1F916}", // 🤖
|
|
71
|
+
task_output: "\u{1F916}", // 🤖
|
|
72
|
+
task_stop: "\u{1F916}", // 🤖
|
|
70
73
|
};
|
|
71
74
|
export function getToolEmoji(name) {
|
|
72
75
|
return TOOL_EMOJI_MAP[name] ?? TOOL_EMOJI_MAP[normalizeToolName(name)] ?? "\u{1F527}"; // 🔧
|
package/dist/src/orchestrator.js
CHANGED
|
@@ -1508,6 +1508,43 @@ async function handleCommandInternal(platform, text, chatId, openId, msgTimestam
|
|
|
1508
1508
|
error: err.message,
|
|
1509
1509
|
});
|
|
1510
1510
|
console.log(`[${ts()}] [INFO] Cannot get chat info for ${chatId}: ${err.message}`);
|
|
1511
|
+
// 群信息接口偶尔会返回 HTML 错误页,不能因此把已有会话误判为新群并
|
|
1512
|
+
// 发送欢迎卡片。群描述仍是正常路径的权威来源;仅在读取失败时,使用
|
|
1513
|
+
// 本地 registry 中最后一次成功确认的群绑定作为降级路由。
|
|
1514
|
+
const registry = await loadSessionRegistryForBinding();
|
|
1515
|
+
const record = registry[chatId];
|
|
1516
|
+
if (record?.sessionId && record.tool && record.chatType !== "p2p") {
|
|
1517
|
+
sessionId = record.sessionId;
|
|
1518
|
+
descriptionTool = record.tool;
|
|
1519
|
+
toolLabel = toolDisplayName(descriptionTool);
|
|
1520
|
+
bindChatToSession(sessionId, chatId);
|
|
1521
|
+
const memoryInfo = sessionInfoMap.get(chatId);
|
|
1522
|
+
if (!memoryInfo || memoryInfo.sessionId !== sessionId) {
|
|
1523
|
+
sessionInfoMap.set(chatId, {
|
|
1524
|
+
sessionId,
|
|
1525
|
+
tool: descriptionTool,
|
|
1526
|
+
turnCount: record.turnCount ?? 0,
|
|
1527
|
+
lastContextTokens: record.lastContextTokens ?? 0,
|
|
1528
|
+
startTime: record.startTime ?? Date.now(),
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
logTrace(tid, "BRANCH", {
|
|
1532
|
+
reason: "group_registry_fallback",
|
|
1533
|
+
sessionId,
|
|
1534
|
+
tool: descriptionTool,
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
else {
|
|
1538
|
+
logTrace(tid, "SEND", {
|
|
1539
|
+
method: "group_route_error",
|
|
1540
|
+
chatId,
|
|
1541
|
+
});
|
|
1542
|
+
await platform.sendCard(chatId, "会话识别失败", "暂时无法读取群信息,请稍后重试。本条消息未发送给 Agent。", "yellow").catch(() => { });
|
|
1543
|
+
logTrace(tid, "DONE", {
|
|
1544
|
+
outcome: "group_route_error",
|
|
1545
|
+
});
|
|
1546
|
+
return;
|
|
1547
|
+
}
|
|
1511
1548
|
}
|
|
1512
1549
|
}
|
|
1513
1550
|
else if (platform.kind === "wechat" || platform.kind === "feishu") {
|
|
@@ -1579,6 +1616,7 @@ async function handleCommandInternal(platform, text, chatId, openId, msgTimestam
|
|
|
1579
1616
|
const chatKind = chatType === "p2p" ? "p2p chat" : "session group";
|
|
1580
1617
|
console.log(`[${ts()}] [ROUTE] ${toolLabel} ${chatKind} ${routeKind} detected, session=${sessionId} tool=${descriptionTool}`);
|
|
1581
1618
|
if (chatType !== "p2p" &&
|
|
1619
|
+
chatInfo &&
|
|
1582
1620
|
isUntitledSessionChatName(chatInfo.name) &&
|
|
1583
1621
|
(await fixedSessionChatName(chatId)) === null &&
|
|
1584
1622
|
!isCommandText) {
|