@wu529778790/open-im 1.10.9-beta.23 → 1.10.9-beta.24

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.
@@ -18,10 +18,6 @@ export interface QRLoginResult {
18
18
  userId?: string;
19
19
  message: string;
20
20
  }
21
- export declare function fetchQRCode(): Promise<{
22
- qrcode: string;
23
- qrcodeUrl: string;
24
- }>;
25
21
  /**
26
22
  * Start QR code login session. Returns QR code URL for display.
27
23
  */
@@ -21,7 +21,7 @@ function buildHeaders() {
21
21
  'iLink-App-ClientVersion': '131588', // 2.4.4 encoded
22
22
  };
23
23
  }
24
- export async function fetchQRCode() {
24
+ async function fetchQRCode() {
25
25
  const url = `${ILINK_BASE_URL}/ilink/bot/get_bot_qrcode?bot_type=${BOT_TYPE}`;
26
26
  const res = await fetch(url, {
27
27
  method: 'POST',
@@ -6,13 +6,6 @@
6
6
  */
7
7
  /** Connection state */
8
8
  export type ClawBotState = 'disconnected' | 'connecting' | 'connected' | 'error';
9
- /** ClawBot configuration */
10
- export interface ClawBotConfig {
11
- /** iLink API base URL (default: https://ilinkai.weixin.qq.com) */
12
- apiUrl: string;
13
- /** Bearer token for authentication */
14
- apiToken: string;
15
- }
16
9
  /** iLink message content item types */
17
10
  export declare const enum MessageItemType {
18
11
  NONE = 0,
@@ -37,4 +37,3 @@ export declare function flushBufferedPayloads(state: {
37
37
  */
38
38
  export declare function mergeAssistantReply(previous: string, incoming: string): string;
39
39
  export declare function runCodeBuddy(cliPath: string, prompt: string, sessionId: string | undefined, workDir: string, callbacks: CodeBuddyRunCallbacks, options?: CodeBuddyRunOptions): CodeBuddyRunHandle;
40
- export declare function checkCodeBuddyCliAvailable(cliPath: string): boolean;
@@ -385,7 +385,7 @@ export function runCodeBuddy(cliPath, prompt, sessionId, workDir, callbacks, opt
385
385
  },
386
386
  };
387
387
  }
388
- export function checkCodeBuddyCliAvailable(cliPath) {
388
+ function checkCodeBuddyCliAvailable(cliPath) {
389
389
  const target = normalizeCliPath(cliPath);
390
390
  if (isAbsolute(target) || target.includes('/') || target.includes('\\')) {
391
391
  try {
@@ -16,7 +16,6 @@ export declare function getHealthPlatformSnapshot(file: FileConfig, env?: NodeJS
16
16
  export declare function testPlatformConfig(platform: string, config: Record<string, unknown>): Promise<string>;
17
17
  export declare function getWebConfigPort(): number;
18
18
  export declare function getWebConfigUrl(): string;
19
- export declare function openWebConfigUrl(): void;
20
19
  export declare function startWebConfigServer(options: {
21
20
  mode: WebFlowMode;
22
21
  cwd: string;
@@ -816,7 +816,7 @@ export function getWebConfigPort() {
816
816
  export function getWebConfigUrl() {
817
817
  return `http://127.0.0.1:${getWebConfigPort()}`;
818
818
  }
819
- export function openWebConfigUrl() {
819
+ function openWebConfigUrl() {
820
820
  openBrowser(getPublicWebDashboardUrl());
821
821
  }
822
822
  export async function startWebConfigServer(options) {
@@ -2,7 +2,6 @@
2
2
  * CardKit 流式卡片管理 - 打字机效果
3
3
  * 参考 cc-im: https://github.com/congqiu/cc-im
4
4
  */
5
- export declare function stopCleanupTimer(): void;
6
5
  /** 创建 CardKit 卡片实例 */
7
6
  export declare function createCard(cardJson: string): Promise<string>;
8
7
  /** 启用流式模式 */
@@ -48,7 +48,7 @@ function ensureCleanupTimer() {
48
48
  }, CLEANUP_INTERVAL_MS);
49
49
  cleanupTimer.unref?.();
50
50
  }
51
- export function stopCleanupTimer() {
51
+ function stopCleanupTimer() {
52
52
  if (cleanupTimer) {
53
53
  clearInterval(cleanupTimer);
54
54
  cleanupTimer = null;
@@ -15,7 +15,5 @@ export declare function sendErrorCard(cardId: string, error: string): Promise<vo
15
15
  export declare function updateMessage(chatId: string, messageId: string, content: string, status: MessageStatus, note?: string, toolId?: string): Promise<void>;
16
16
  export declare function sendFinalMessages(chatId: string, messageId: string, fullContent: string, note: string, toolId?: string): Promise<void>;
17
17
  export declare function sendTextReply(chatId: string, text: string): Promise<void>;
18
- /** 使用 open_id 发送(私聊时 context 可能只有 open_id) */
19
- export declare function sendTextReplyByOpenId(openId: string, text: string): Promise<void>;
20
18
  export declare function sendImageReply(chatId: string, imagePath: string): Promise<void>;
21
19
  export declare function startTypingLoop(_chatId: string): () => void;
@@ -329,7 +329,7 @@ export async function sendTextReply(chatId, text) {
329
329
  }
330
330
  }
331
331
  /** 使用 open_id 发送(私聊时 context 可能只有 open_id) */
332
- export async function sendTextReplyByOpenId(openId, text) {
332
+ async function sendTextReplyByOpenId(openId, text) {
333
333
  const client = getClient();
334
334
  const cardContent = createFeishuCard(OPEN_IM_SYSTEM_TITLE, text, 'done');
335
335
  try {
package/dist/setup.d.ts CHANGED
@@ -3,15 +3,8 @@
3
3
  * 使用 prompts 库,兼容 tsx watch、IDE 终端等环境
4
4
  * Telegram Token 使用 readline 避免 Windows 终端 prompts 重绘问题
5
5
  */
6
- import type { Config } from "./config.js";
7
6
  /**
8
7
  * Claude API 专用配置向导,保存到 ~/.claude/settings.json(与 Claude Code 共用)
9
8
  */
10
9
  export declare function runClaudeApiSetup(): Promise<boolean>;
11
10
  export declare function runInteractiveSetup(): Promise<boolean>;
12
- /**
13
- * 启动时让用户选择要启用的平台(无论单通道还是多通道)
14
- * 显示全部 4 个平台,已配置的预选;若用户选择未配置的,引导运行 init
15
- * @returns 更新后的 config,或 null 表示取消
16
- */
17
- export declare function runPlatformSelectionPrompt(config: Config): Promise<Config | null>;
package/dist/setup.js CHANGED
@@ -1132,7 +1132,7 @@ const ALL_PLATFORMS = ["telegram", "feishu", "qq", "wework", "dingtalk", "workbu
1132
1132
  * 显示全部 4 个平台,已配置的预选;若用户选择未配置的,引导运行 init
1133
1133
  * @returns 更新后的 config,或 null 表示取消
1134
1134
  */
1135
- export async function runPlatformSelectionPrompt(config) {
1135
+ async function runPlatformSelectionPrompt(config) {
1136
1136
  const withCreds = new Set(getPlatformsWithCredentials(config));
1137
1137
  const configPath = join(APP_HOME, "config.json");
1138
1138
  const existing = loadExistingConfig();
@@ -6,8 +6,8 @@ export interface DingTalkActiveTarget {
6
6
  updatedAt: number;
7
7
  }
8
8
  export declare function loadActiveChats(): void;
9
- export declare function getActiveChatId(platform: 'dingtalk' | 'feishu' | 'qq' | 'telegram' | 'wechat' | 'wework' | 'workbuddy' | 'clawbot'): string | undefined;
10
- export declare function setActiveChatId(platform: 'dingtalk' | 'feishu' | 'qq' | 'telegram' | 'wechat' | 'wework' | 'workbuddy' | 'clawbot', chatId: string): void;
9
+ export declare function getActiveChatId(platform: 'dingtalk' | 'feishu' | 'qq' | 'telegram' | 'wework' | 'workbuddy' | 'clawbot'): string | undefined;
10
+ export declare function setActiveChatId(platform: 'dingtalk' | 'feishu' | 'qq' | 'telegram' | 'wework' | 'workbuddy' | 'clawbot', chatId: string): void;
11
11
  export declare function getDingTalkActiveTarget(): DingTalkActiveTarget | undefined;
12
12
  export declare function setDingTalkActiveTarget(target: Omit<DingTalkActiveTarget, 'updatedAt'>): void;
13
13
  export declare function flushActiveChats(): void;
@@ -20,8 +20,6 @@ export declare function handleEnqueueResult(enqueueResult: EnqueueResult, sendTe
20
20
  export declare function toReplyPlainText(value: unknown): string;
21
21
  /** 转义路径供 Markdown 显示,防止 xxx.yyy.com 被解析为链接 */
22
22
  export declare function escapePathForMarkdown(path: string): string;
23
- /** AI 工具显示名称映射(aiCommand -> 用户友好名称) */
24
- export declare const AI_TOOL_DISPLAY_NAMES: Record<string, string>;
25
23
  /** 获取 AI 工具的显示名称 */
26
24
  export declare function getAIToolDisplayName(aiCommand: string): string;
27
25
  export declare function truncateText(text: string, maxLen: number): string;
@@ -40,7 +40,7 @@ export function escapePathForMarkdown(path) {
40
40
  return `\`${path.replace(/`/g, '\\`')}\``;
41
41
  }
42
42
  /** AI 工具显示名称映射(aiCommand -> 用户友好名称) */
43
- export const AI_TOOL_DISPLAY_NAMES = {
43
+ const AI_TOOL_DISPLAY_NAMES = {
44
44
  claude: 'Claude Code',
45
45
  /** ClaudeSDKAdapter.toolId,与 claude 相同展示名 */
46
46
  'claude-sdk': 'Claude Code',
@@ -1,6 +1,5 @@
1
1
  import { Telegraf } from "telegraf";
2
2
  import type { Config } from "../config.js";
3
3
  export declare function getBot(): Telegraf;
4
- export declare function getBotUsername(): string | undefined;
5
4
  export declare function initTelegram(config: Config, setupHandlers: (bot: Telegraf) => void): Promise<void>;
6
5
  export declare function stopTelegram(): void;
@@ -9,7 +9,7 @@ export function getBot() {
9
9
  throw new Error("Telegram bot not initialized");
10
10
  return bot;
11
11
  }
12
- export function getBotUsername() {
12
+ function getBotUsername() {
13
13
  return botUsername;
14
14
  }
15
15
  export async function initTelegram(config, setupHandlers) {
@@ -32,13 +32,6 @@ export interface WeWorkResponse {
32
32
  errcode: number;
33
33
  errmsg: string;
34
34
  }
35
- export interface WeWorkSubscribeRequest extends WeWorkRequest {
36
- cmd: WeWorkCommand.SUBSCRIBE;
37
- body: {
38
- secret: string;
39
- bot_id: string;
40
- };
41
- }
42
35
  export interface WeWorkCallbackMessage {
43
36
  cmd: WeWorkCommand.AIBOT_CALLBACK;
44
37
  headers: {
@@ -126,11 +119,6 @@ export interface WeWorkResponseMessage extends WeWorkRequest {
126
119
  };
127
120
  };
128
121
  }
129
- export interface MessageState {
130
- accumulatedText: string;
131
- /** 流式回复的 streamId,用于保持同一个流式回复使用相同的 streamId */
132
- streamId?: string;
133
- }
134
122
  export interface WeWorkHttpResponseBody {
135
123
  msgtype: 'text' | 'markdown' | 'stream';
136
124
  text?: {
@@ -152,7 +140,3 @@ export interface WeWorkHttpResponseBody {
152
140
  }>;
153
141
  };
154
142
  }
155
- export interface WeWorkHttpResponse {
156
- msgtype: 'text' | 'markdown' | 'stream';
157
- [key: string]: unknown;
158
- }
@@ -5,11 +5,8 @@
5
5
  * auto-reconnect on drop.
6
6
  */
7
7
  import type { Config } from '../config.js';
8
- import { WorkBuddyOAuth } from './oauth.js';
9
8
  import { WorkBuddyCentrifugeClient } from './centrifuge-client.js';
10
9
  import type { WorkBuddyState } from './types.js';
11
- export declare function getChannelState(): WorkBuddyState;
12
10
  export declare function initWorkBuddy(config: Config, eventHandler: (chatId: string, msgId: string, content: string) => Promise<void>, onStateChange?: (state: WorkBuddyState) => void): Promise<void>;
13
11
  export declare function getCentrifugeClient(): WorkBuddyCentrifugeClient | null;
14
- export declare function getOAuth(): WorkBuddyOAuth | null;
15
12
  export declare function stopWorkBuddy(): void;
@@ -29,7 +29,7 @@ let stopped = false;
29
29
  let platformConfig = null;
30
30
  /** 单飞刷新 token 的在途 Promise,避免并发 401 重复刷新 */
31
31
  let refreshInFlight = null;
32
- export function getChannelState() {
32
+ function getChannelState() {
33
33
  return channelState;
34
34
  }
35
35
  export async function initWorkBuddy(config, eventHandler, onStateChange) {
@@ -270,7 +270,7 @@ function updateState(state) {
270
270
  export function getCentrifugeClient() {
271
271
  return centrifugeClient;
272
272
  }
273
- export function getOAuth() {
273
+ function getOAuth() {
274
274
  return oauthClient;
275
275
  }
276
276
  /**
@@ -10,7 +10,3 @@ export declare function sendTextReply(_client: WorkBuddyCentrifugeClient | null,
10
10
  * Send error response to WeChat KF
11
11
  */
12
12
  export declare function sendErrorReply(_client: WorkBuddyCentrifugeClient | null, chatId: string, error: string, msgId: string): Promise<void>;
13
- /**
14
- * Send streaming chunk to WeChat KF
15
- */
16
- export declare function sendStreamingChunk(_client: WorkBuddyCentrifugeClient | null, chatId: string, text: string, msgId: string): void;
@@ -63,7 +63,7 @@ export async function sendErrorReply(_client, chatId, error, msgId) {
63
63
  /**
64
64
  * Send streaming chunk to WeChat KF
65
65
  */
66
- export function sendStreamingChunk(_client, chatId, text, msgId) {
66
+ function sendStreamingChunk(_client, chatId, text, msgId) {
67
67
  const client = _client ?? getCentrifugeClient();
68
68
  if (!client) {
69
69
  log.warn('WorkBuddy client not available, cannot send chunk');
@@ -27,18 +27,6 @@ export interface CentrifugeTokens {
27
27
  /** Channel name */
28
28
  channel: string;
29
29
  }
30
- /** WeChat KF message from Centrifuge */
31
- export interface WeChatKfMessage {
32
- chatId: string;
33
- msgId: string;
34
- content: string;
35
- msgType?: string;
36
- user?: {
37
- nickname?: string;
38
- avatar?: string;
39
- };
40
- timestamp?: number;
41
- }
42
30
  /** AGP envelope format (for compatibility with existing handlers) */
43
31
  export interface AGPEnvelope<T = unknown> {
44
32
  msg_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.10.9-beta.23",
3
+ "version": "1.10.9-beta.24",
4
4
  "description": "Multi-platform IM bridge for AI CLI tools (Claude, Codex, CodeBuddy)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",