@wu529778790/open-im 1.11.4-beta.10 → 1.11.4-beta.11

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.
@@ -132,6 +132,10 @@ function startPolling() {
132
132
  cacheContextToken(chatId, msg.context_token);
133
133
  setClawbotContextToken(msg.context_token);
134
134
  }
135
+ // Debug: log raw item_list for image messages
136
+ if (extracted === '[图片]') {
137
+ log.info(`Image message raw item_list: ${JSON.stringify(msg.item_list).substring(0, 500)}`);
138
+ }
135
139
  // Extract and download images from message
136
140
  const imagePaths = await extractImages(msg);
137
141
  userMessages.push({ chatId, msgId, content: extracted, imagePaths: imagePaths.length > 0 ? imagePaths : undefined });
@@ -247,11 +251,15 @@ async function extractImages(msg) {
247
251
  return [];
248
252
  const paths = [];
249
253
  for (const item of msg.item_list) {
254
+ // 调试:记录所有 item 类型
255
+ log.info(`Item type=${item.type}, has image_item=${!!item.image_item}, has media=${!!item.image_item?.media}, has cdn_url=${!!item.image_item?.media?.cdn_url}`);
250
256
  if (item.type !== 2 /* MessageItemType.IMAGE */)
251
257
  continue;
252
258
  const media = item.image_item?.media;
253
- if (!media?.cdn_url)
259
+ if (!media?.cdn_url) {
260
+ log.warn(`Image item missing cdn_url: ${JSON.stringify(item.image_item).substring(0, 200)}`);
254
261
  continue;
262
+ }
255
263
  try {
256
264
  // Download from CDN
257
265
  const response = await fetch(media.cdn_url, { signal: AbortSignal.timeout(30_000) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.11.4-beta.10",
3
+ "version": "1.11.4-beta.11",
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",