@raolin2025/claude-code-node 2.6.6 → 2.6.8

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/package.json +1 -1
  2. package/src/core/cli.js +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raolin2025/claude-code-node",
3
- "version": "2.6.6",
3
+ "version": "2.6.8",
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",
package/src/core/cli.js CHANGED
@@ -998,6 +998,9 @@ const systemPrompt = cliArgs.systemPrompt || DEFAULT_SYSTEM_PROMPT
998
998
  channels: config.get('channels') || {},
999
999
  defaultChannel: config.get('defaultChannel') || process.env.CC_NODE_CHANNEL_DEFAULT || null,
1000
1000
  onMessage: async (msg) => {
1001
+ // 记录全局回复目标,供权限确认 / AI 回复镜像发送到 Telegram 使用
1002
+ if (msg.chatId) tgChatId = msg.chatId
1003
+ if (msg.replyTo) tgReplyTarget = msg.replyTo
1001
1004
  // 来自外部的消息 → 转发到 REPL 引擎
1002
1005
  const text = msg.text || ''
1003
1006
  if (text && !text.startsWith('/')) {
@@ -1005,6 +1008,9 @@ const systemPrompt = cliArgs.systemPrompt || DEFAULT_SYSTEM_PROMPT
1005
1008
  }
1006
1009
  },
1007
1010
  })
1011
+ // 关键:把 startBuiltinListeners 内置监听器的 tgListener 赋给全局 tgListener,
1012
+ // 否则 onConfirmTool 的 tgListener?.bot 恒为 false,权限确认不会推送 Telegram。
1013
+ if (builtinNotify?.tgListener) tgListener = builtinNotify.tgListener
1008
1014
  console.log('📡 Built-in channel listeners started (--with-notify)')
1009
1015
  }
1010
1016