@raolin2025/claude-code-node 2.6.16 → 2.6.17

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raolin2025/claude-code-node",
3
- "version": "2.6.16",
3
+ "version": "2.6.17",
4
4
  "description": "Node.js AI Code Agent CLI - Zero dependencies, pure JavaScript, security hardened, multi-channel notifications, Telegram & QQ Bot remote programming, rich media upload, multi-account management",
5
5
  "type": "module",
6
6
  "main": "src/core/index.js",
@@ -118,7 +118,9 @@ export class TelegramBotClient {
118
118
  const body = {
119
119
  chat_id: chatId,
120
120
  text: text.slice(0, 4096), // Telegram 消息最大 4096 字符
121
- parse_mode: parseMode || 'HTML',
121
+ // parseMode: null 表示降级为纯文本(去掉 parse_mode 字段);
122
+ // 否则默认 HTML,或用显式指定的 parseMode。
123
+ ...(parseMode === null ? {} : { parse_mode: parseMode || 'HTML' }),
122
124
  disable_notification: silent || false,
123
125
  disable_web_page_preview: disableWebPreview ?? true,
124
126
  }
@@ -139,9 +141,9 @@ export class TelegramBotClient {
139
141
  await new Promise(r => setTimeout(r, retryAfter * 1000))
140
142
  return this.sendMessage(chatId, text, options)
141
143
  }
142
- // 400 可能是消息太长或格式问题 — 降级为纯文本
144
+ // 400 可能是消息太长或格式问题 — 降级为纯文本(parseMode: null 去掉 parse_mode)
143
145
  if (data.error_code === 400 && parseMode) {
144
- return this.sendMessage(chatId, text, { ...options, parseMode: undefined })
146
+ return this.sendMessage(chatId, text, { ...options, parseMode: null })
145
147
  }
146
148
  throw new Error(`Telegram API ${data.error_code}: ${data.description?.slice(0, 200) || 'unknown'}`)
147
149
  }
package/src/core/cli.js CHANGED
@@ -694,9 +694,9 @@ const systemPrompt = cliArgs.systemPrompt || DEFAULT_SYSTEM_PROMPT
694
694
  modelList.forEach((id, i) => {
695
695
  console.log(` ${(i + 1).toString().padStart(2)}. ${id}`)
696
696
  })
697
- // 来自 Telegram:直接列出,不等待 CLI 交互(用 /model <名字或编号> 切换)
697
+ // 来自 Telegram:直接列出,不等待 CLI 交互(用 /model 名字或编号 切换)
698
698
  if (source === 'telegram') {
699
- console.log('\nℹ️ 用 /model <名字或编号> 切换模型')
699
+ console.log('\nℹ️ 用 /model 名字或编号 切换模型')
700
700
  break
701
701
  }
702
702
  console.log('\nType a number to select, or model name directly:')