@wu529778790/open-im 1.9.3-beta.0 → 1.9.3-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.
Files changed (2) hide show
  1. package/dist/index.js +10 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { createServer } from "node:http";
2
2
  import { writeFileSync, existsSync, mkdirSync, unlinkSync } from "node:fs";
3
+ import { randomUUID } from "node:crypto";
3
4
  import { dirname, join } from "node:path";
4
5
  import { getConfiguredAiCommands, loadConfig, needsSetup, resolvePlatformAiCommand } from "./config.js";
5
6
  import { runInteractiveSetup, runClaudeApiSetup } from "./setup.js";
@@ -22,6 +23,7 @@ import { initDingTalk, stopDingTalk, formatDingTalkInitError } from "./dingtalk/
22
23
  import { setupDingTalkHandlers } from "./dingtalk/event-handler.js";
23
24
  import { initWorkBuddy, stopWorkBuddy } from "./workbuddy/client.js";
24
25
  import { setupWorkBuddyHandlers } from "./workbuddy/event-handler.js";
26
+ import { sendTextReply as sendWorkBuddyTextReply } from "./workbuddy/message-sender.js";
25
27
  import { initAdapters, cleanupAdapters } from "./adapters/registry.js";
26
28
  import { SessionManager } from "./session/session-manager.js";
27
29
  import { loadActiveChats, getActiveChatId, flushActiveChats, } from "./shared/active-chats.js";
@@ -33,13 +35,14 @@ const require = createRequire(import.meta.url);
33
35
  const { version: APP_VERSION } = require("../package.json");
34
36
  const log = createLogger("Main");
35
37
  async function sendLifecycleNotification(platform, message) {
36
- // DingTalk 和 WorkBuddy 不支持主动发消息(OpenAPI 需 robotCode 等,易报 robot 不存在),跳过启动/关闭通知
37
- if (platform === "dingtalk" || platform === "workbuddy")
38
+ // DingTalk 不支持主动发消息(OpenAPI 需 robotCode 等,易报 robot 不存在),跳过启动/关闭通知
39
+ if (platform === "dingtalk")
38
40
  return;
39
41
  const telegramChatId = getActiveChatId("telegram");
40
42
  const feishuChatId = getActiveChatId("feishu");
41
43
  const qqChatId = getActiveChatId("qq");
42
44
  const weworkChatId = getActiveChatId("wework");
45
+ const workbuddyChatId = getActiveChatId("workbuddy");
43
46
  const sendPromises = [];
44
47
  if (platform === "telegram" && telegramChatId) {
45
48
  sendPromises.push(sendTelegramTextReply(telegramChatId, message).catch((err) => {
@@ -61,6 +64,11 @@ async function sendLifecycleNotification(platform, message) {
61
64
  log.debug("Failed to send WeWork notification:", err);
62
65
  }));
63
66
  }
67
+ if (platform === "workbuddy" && workbuddyChatId) {
68
+ sendPromises.push(sendWorkBuddyTextReply(null, workbuddyChatId, message, randomUUID()).catch((err) => {
69
+ log.debug("Failed to send WorkBuddy notification:", err);
70
+ }));
71
+ }
64
72
  await Promise.all(sendPromises);
65
73
  }
66
74
  function buildStartupMessage(platform, appVersion, aiCommand, defaultWorkDir, sessionManager) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.9.3-beta.0",
3
+ "version": "1.9.3-beta.1",
4
4
  "description": "Multi-platform IM bridge for AI CLI tools (Claude, Codex, CodeBuddy)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",