@wu529778790/open-im 1.11.3-beta.1 → 1.11.3-beta.3

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.
@@ -21,7 +21,7 @@ const OLD_ROOT_KEYS = [
21
21
  'claudeTimeoutMs',
22
22
  'claudeModel',
23
23
  ];
24
- const AI_COMMANDS = ['claude', 'codex', 'codebuddy'];
24
+ const AI_COMMANDS = ['claude', 'codex', 'codebuddy', 'opencode'];
25
25
  const require = createRequire(import.meta.url);
26
26
  /** Claude 认证相关的环境变量 key 列表 */
27
27
  export const CLAUDE_AUTH_ENV_KEYS = [
package/dist/config.js CHANGED
@@ -563,7 +563,7 @@ export function getPlatformsWithCredentials(config) {
563
563
  }
564
564
  export function resolvePlatformAiCommand(config, platform) {
565
565
  const v = config.platforms[platform]?.aiCommand;
566
- return v === 'claude' || v === 'codex' || v === 'codebuddy' ? v : 'claude';
566
+ return v === 'claude' || v === 'codex' || v === 'codebuddy' || v === 'opencode' ? v : 'claude';
567
567
  }
568
568
  export function getConfiguredAiCommands(config) {
569
569
  const commands = new Set();
@@ -361,7 +361,7 @@ export class SessionManager {
361
361
  }
362
362
  }
363
363
  clearConvSessionMappings(userId, convId) {
364
- for (const toolId of ['claude', 'codex', 'codebuddy']) {
364
+ for (const toolId of ['claude', 'codex', 'codebuddy', 'opencode']) {
365
365
  this.convSessionMap.delete(this.getConvSessionKey(userId, convId, toolId));
366
366
  }
367
367
  }
@@ -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.1",
3
+ "version": "1.11.3-beta.3",
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",