@wu529778790/open-im 1.11.13-beta.0 → 1.11.13-beta.1

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.
@@ -180,7 +180,7 @@ function buildCompletionNote(result, sessionManager, ctx) {
180
180
  parts.push(ctxWarning);
181
181
  return parts.join(' | ');
182
182
  }
183
- function buildRunOptions(config, sessionManager, ctx, aiCommand, toolAdapter) {
183
+ function buildRunOptions(config, sessionManager, ctx, aiCommand) {
184
184
  // 权限 hook 尚未接入 IM,暂时全局跳过
185
185
  const defaultSkipPermissions = true;
186
186
  return {
@@ -474,7 +474,7 @@ export function runAITask(deps, ctx, prompt, toolAdapter, platformAdapter) {
474
474
  cleanup();
475
475
  resolve();
476
476
  },
477
- }, buildRunOptions(config, sessionManager, ctx, aiCommand, toolAdapter));
477
+ }, buildRunOptions(config, sessionManager, ctx, aiCommand));
478
478
  return activeHandle;
479
479
  };
480
480
  taskState = {
@@ -51,7 +51,7 @@ async function ping(target, workDir) {
51
51
  try {
52
52
  handle.abort();
53
53
  }
54
- catch (err) {
54
+ catch {
55
55
  // 中止失败,忽略错误
56
56
  }
57
57
  settle(false, `timeout after ${PING_TIMEOUT_MS}ms`);
@@ -3,15 +3,11 @@ import { createLogger } from "../logger.js";
3
3
  import { isFatalReconnectError, jitteredDelay } from "../shared/reconnect.js";
4
4
  const log = createLogger("Telegram");
5
5
  let bot;
6
- let botUsername;
7
6
  export function getBot() {
8
7
  if (!bot)
9
8
  throw new Error("Telegram bot not initialized");
10
9
  return bot;
11
10
  }
12
- function getBotUsername() {
13
- return botUsername;
14
- }
15
11
  export async function initTelegram(config, setupHandlers) {
16
12
  const token = config.telegramBotToken ?? "";
17
13
  if (!token) {
@@ -19,8 +15,7 @@ export async function initTelegram(config, setupHandlers) {
19
15
  }
20
16
  bot = new Telegraf(token);
21
17
  setupHandlers(bot);
22
- const me = (await bot.telegram.getMe());
23
- botUsername = me.username;
18
+ await bot.telegram.getMe();
24
19
  const launchWithRetry = async (attempt = 1) => {
25
20
  try {
26
21
  await bot.launch();
@@ -40,9 +40,6 @@ const reconnectManager = new ReconnectManager({
40
40
  }
41
41
  },
42
42
  });
43
- function getChannelState() {
44
- return stateManager.current;
45
- }
46
43
  export async function initWorkBuddy(config, eventHandler, onStateChange) {
47
44
  const pc = config.platforms?.workbuddy;
48
45
  if (!pc?.enabled) {
@@ -242,9 +239,6 @@ async function connect() {
242
239
  export function getCentrifugeClient() {
243
240
  return centrifugeClient;
244
241
  }
245
- function getOAuth() {
246
- return oauthClient;
247
- }
248
242
  /**
249
243
  * 单飞刷新 WorkBuddy access token:并发 401 只触发一次刷新,复用同一 Promise。
250
244
  * 刷新成功后 oauthClient.accessToken 原地更新,所有 HTTP 调用(含心跳)自动用新 token。
@@ -41,14 +41,3 @@ export async function sendErrorReply(_client, chatId, error, msgId) {
41
41
  stop_reason: 'error',
42
42
  });
43
43
  }
44
- /**
45
- * Send streaming chunk to WeChat KF
46
- */
47
- function sendStreamingChunk(_client, chatId, text, msgId) {
48
- const client = _client ?? getCentrifugeClient();
49
- if (!client) {
50
- log.warn('WorkBuddy client not available, cannot send chunk');
51
- return;
52
- }
53
- client.sendMessageChunk(chatId, msgId, { type: 'text', text: toReplyPlainText(text) });
54
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.11.13-beta.0",
3
+ "version": "1.11.13-beta.1",
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",