@wu529778790/open-im 1.8.1-beta.18 → 1.8.1-beta.19
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.
|
@@ -19,7 +19,6 @@ export declare class CommandHandler {
|
|
|
19
19
|
private deps;
|
|
20
20
|
constructor(deps: CommandHandlerDeps);
|
|
21
21
|
dispatch(text: string, chatId: string, userId: string, platform: 'dingtalk' | 'feishu' | 'qq' | 'telegram' | 'wechat' | 'wework' | 'workbuddy', handleClaudeRequest: ClaudeRequestHandler): Promise<boolean>;
|
|
22
|
-
private getClearHistoryHint;
|
|
23
22
|
private handleHelp;
|
|
24
23
|
private handleNew;
|
|
25
24
|
private handlePwd;
|
package/dist/commands/handler.js
CHANGED
|
@@ -16,9 +16,9 @@ export class CommandHandler {
|
|
|
16
16
|
return true;
|
|
17
17
|
}
|
|
18
18
|
if (t === '/help')
|
|
19
|
-
return this.handleHelp(chatId
|
|
19
|
+
return this.handleHelp(chatId);
|
|
20
20
|
if (t === '/new')
|
|
21
|
-
return this.handleNew(chatId, userId
|
|
21
|
+
return this.handleNew(chatId, userId);
|
|
22
22
|
if (t === '/pwd')
|
|
23
23
|
return this.handlePwd(chatId, userId);
|
|
24
24
|
if (t === '/status')
|
|
@@ -33,18 +33,7 @@ export class CommandHandler {
|
|
|
33
33
|
}
|
|
34
34
|
return false;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
return platform === 'feishu'
|
|
38
|
-
? '💡 提示:如需清除本对话的历史消息,请点击飞书聊天右上角「...」→ 清除聊天记录'
|
|
39
|
-
: platform === 'wechat'
|
|
40
|
-
? '💡 提示:如需清除本对话的历史消息,请清除聊天记录'
|
|
41
|
-
: platform === 'dingtalk'
|
|
42
|
-
? '💡 提示:如需清除本对话的历史消息,请在钉钉中清空聊天记录'
|
|
43
|
-
: platform === 'workbuddy'
|
|
44
|
-
? '💡 提示:如需清除本对话的历史消息,请清除聊天记录'
|
|
45
|
-
: '💡 提示:如需清除本对话的历史消息,请点击 Telegram 聊天右上角 ⋮ → 清除历史';
|
|
46
|
-
}
|
|
47
|
-
async handleHelp(chatId, platform) {
|
|
36
|
+
async handleHelp(chatId) {
|
|
48
37
|
const help = [
|
|
49
38
|
'📋 可用命令:',
|
|
50
39
|
'',
|
|
@@ -53,16 +42,14 @@ export class CommandHandler {
|
|
|
53
42
|
'/status - 显示状态',
|
|
54
43
|
'/cd <路径> - 切换工作目录',
|
|
55
44
|
'/pwd - 当前工作目录',
|
|
56
|
-
'',
|
|
57
|
-
this.getClearHistoryHint(platform),
|
|
58
45
|
].join('\n');
|
|
59
46
|
await this.deps.sender.sendTextReply(chatId, help);
|
|
60
47
|
return true;
|
|
61
48
|
}
|
|
62
|
-
async handleNew(chatId, userId
|
|
49
|
+
async handleNew(chatId, userId) {
|
|
63
50
|
const ok = this.deps.sessionManager.newSession(userId);
|
|
64
51
|
await this.deps.sender.sendTextReply(chatId, ok
|
|
65
|
-
?
|
|
52
|
+
? '✅ AI 会话已重置,下一条消息将使用全新上下文。'
|
|
66
53
|
: '当前没有活动会话。');
|
|
67
54
|
return true;
|
|
68
55
|
}
|
|
@@ -103,8 +90,7 @@ export class CommandHandler {
|
|
|
103
90
|
try {
|
|
104
91
|
const resolved = await this.deps.sessionManager.setWorkDir(userId, dir);
|
|
105
92
|
await this.deps.sender.sendTextReply(chatId, `📁 工作目录已切换到: ${escapePathForMarkdown(resolved)}\n\n` +
|
|
106
|
-
`🔄 AI
|
|
107
|
-
this.getClearHistoryHint(platform));
|
|
93
|
+
`🔄 AI 会话已重置,下一条消息将使用全新上下文。`);
|
|
108
94
|
}
|
|
109
95
|
catch (err) {
|
|
110
96
|
await this.deps.sender.sendTextReply(chatId, err instanceof Error ? err.message : String(err));
|