@wu529778790/open-im 1.11.3-beta.0 → 1.11.3-beta.2

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/dist/setup.js CHANGED
@@ -321,7 +321,7 @@ export async function runInteractiveSetup() {
321
321
  },
322
322
  {
323
323
  title: "ClawBot 微信 iLink (需要 API Token)" +
324
- (!!existing?.platforms?.clawbot?.apiToken ? " ✓已配置" : ""),
324
+ (existing?.platforms?.clawbot?.apiToken ? " ✓已配置" : ""),
325
325
  value: "clawbot",
326
326
  },
327
327
  { title: "配置多个平台", value: "multi" },
@@ -346,7 +346,7 @@ export async function runInteractiveSetup() {
346
346
  { title: "企业微信 (WeWork)" + (hasWw ? " ✓已配置" : ""), value: "wework", selected: hasWw },
347
347
  { title: "钉钉 (DingTalk)" + (hasDt ? " ✓已配置" : ""), value: "dingtalk", selected: hasDt },
348
348
  { title: "WorkBuddy 微信客服 (WeChat KF)" + (hasWc ? " ✓已配置" : ""), value: "workbuddy", selected: hasWc },
349
- { title: "ClawBot 微信 iLink" + (!!existing?.platforms?.clawbot?.apiToken ? " ✓已配置" : ""), value: "clawbot" },
349
+ { title: "ClawBot 微信 iLink" + (existing?.platforms?.clawbot?.apiToken ? " ✓已配置" : ""), value: "clawbot" },
350
350
  ],
351
351
  }, { onCancel });
352
352
  if (!multiResp.platforms || multiResp.platforms.length === 0) {
@@ -3,7 +3,8 @@
3
3
  */
4
4
  import type { WorkBuddyCentrifugeClient } from './centrifuge-client.js';
5
5
  /**
6
- * Send text reply to WeChat KF, splitting long messages automatically.
6
+ * Send text reply to WeChat KF.
7
+ * 不拆分消息,直接发送完整内容(微信客服会自动截断过长的消息)
7
8
  */
8
9
  export declare function sendTextReply(_client: WorkBuddyCentrifugeClient | null, chatId: string, text: string, msgId: string): Promise<void>;
9
10
  /**
@@ -1,14 +1,13 @@
1
1
  /**
2
2
  * WorkBuddy Message Sender - Send responses to WeChat KF
3
3
  */
4
- import { randomUUID } from 'node:crypto';
5
4
  import { createLogger } from '../logger.js';
6
- import { splitLongContent, toReplyPlainText } from '../shared/utils.js';
7
- import { MAX_WORKBUDDY_MESSAGE_LENGTH } from '../constants.js';
5
+ import { toReplyPlainText } from '../shared/utils.js';
8
6
  import { getCentrifugeClient } from './client.js';
9
7
  const log = createLogger('WorkBuddySender');
10
8
  /**
11
- * Send text reply to WeChat KF, splitting long messages automatically.
9
+ * Send text reply to WeChat KF.
10
+ * 不拆分消息,直接发送完整内容(微信客服会自动截断过长的消息)
12
11
  */
13
12
  export async function sendTextReply(_client, chatId, text, msgId) {
14
13
  const client = _client ?? getCentrifugeClient();
@@ -17,31 +16,13 @@ export async function sendTextReply(_client, chatId, text, msgId) {
17
16
  return;
18
17
  }
19
18
  const plainText = toReplyPlainText(text);
20
- const parts = splitLongContent(plainText, MAX_WORKBUDDY_MESSAGE_LENGTH);
21
- if (parts.length === 1) {
22
- log.info(`Sending WorkBuddy reply to chatId=${chatId}, msgId=${msgId}, len=${plainText.length}`);
23
- await client.sendPromptResponse({
24
- session_id: chatId,
25
- prompt_id: msgId,
26
- content: [{ type: 'text', text: plainText }],
27
- stop_reason: 'end_turn',
28
- });
29
- return;
30
- }
31
- log.info(`Sending WorkBuddy reply in ${parts.length} parts to chatId=${chatId}, msgId=${msgId}, totalLen=${plainText.length}`);
32
- for (let i = 0; i < parts.length; i++) {
33
- const partText = i === 0
34
- ? `${parts[i]}\n\n_(1/${parts.length})_`
35
- : `_(续 ${i + 1}/${parts.length})_\n\n${parts[i]}`;
36
- const partMsgId = i === 0 ? msgId : randomUUID();
37
- await client.sendPromptResponse({
38
- session_id: chatId,
39
- prompt_id: partMsgId,
40
- content: [{ type: 'text', text: partText }],
41
- stop_reason: 'end_turn',
42
- });
43
- log.info(`WorkBuddy part ${i + 1}/${parts.length} sent, msgId=${partMsgId}`);
44
- }
19
+ log.info(`Sending WorkBuddy reply to chatId=${chatId}, msgId=${msgId}, len=${plainText.length}`);
20
+ await client.sendPromptResponse({
21
+ session_id: chatId,
22
+ prompt_id: msgId,
23
+ content: [{ type: 'text', text: plainText }],
24
+ stop_reason: 'end_turn',
25
+ });
45
26
  }
46
27
  /**
47
28
  * Send error response to WeChat KF
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.11.3-beta.0",
3
+ "version": "1.11.3-beta.2",
4
4
  "description": "Your AI coding assistant, in every chat app. Multi-platform IM bridge for Claude Code, Codex, and CodeBuddy.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",