@raolin2025/claude-code-node 2.3.3 → 2.3.5

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 +9 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raolin2025/claude-code-node",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "description": "Node.js AI Code Agent CLI - Zero dependencies, pure JavaScript, security hardened, multi-channel notifications",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/core/cli.js CHANGED
@@ -144,6 +144,7 @@ function buildBanner({ model, permissionMode, session, maxTokens }) {
144
144
  const BLUE = '\x1b[34m'
145
145
  const CYAN = '\x1b[36m'
146
146
  const RESET = '\x1b[0m'
147
+ const RED = '\x1b[31m'
147
148
 
148
149
  // 像素风格 CC 机器人(19字符宽,带颜色边框)
149
150
  const robotRaw = [
@@ -151,8 +152,8 @@ function buildBanner({ model, permissionMode, session, maxTokens }) {
151
152
  ' │ ██ ██ │ ',
152
153
  ' │ ██████ │ ',
153
154
  ' │ ██ ██ │ ',
154
- ' │ │ ',
155
- ' │ ███████ │ ',
155
+ ' │ │ ',
156
+ ' │ ███████ │ ',
156
157
  ' │ ██ ██ │ ',
157
158
  ' │ ██████ │ ',
158
159
  ' │ ██ ██ ██ │ ',
@@ -163,7 +164,7 @@ function buildBanner({ model, permissionMode, session, maxTokens }) {
163
164
  const colorize = (line) =>
164
165
  line
165
166
  .replace(/[┌└─╭╮┐┘│]/g, BLUE + '$&' + RESET)
166
- .replace(/[█]/g, CYAN + '$&' + RESET)
167
+ .replace(/[█]/g, RED + '$&' + RESET)
167
168
 
168
169
  const robotColored = robotRaw.map(colorize)
169
170
 
@@ -171,8 +172,8 @@ function buildBanner({ model, permissionMode, session, maxTokens }) {
171
172
  const stripAnsi = (s) => s.replace(/\x1b\[[0-9;]*m/g, '')
172
173
  const robotPlain = robotColored.map(line => stripAnsi(line))
173
174
 
174
- // 在 col1 内居中(按可见长度 19 计算)
175
- const visibleWidth = 19
175
+ // 在 col1 内居中(按最大可见长度 21 计算,短的自动靠右)
176
+ const visibleWidth = 21
176
177
  const totalCol1 = 24
177
178
  const leftPad = Math.floor((totalCol1 - visibleWidth) / 2)
178
179
  const rightPad = totalCol1 - visibleWidth - leftPad
@@ -214,8 +215,8 @@ function buildBanner({ model, permissionMode, session, maxTokens }) {
214
215
  pad('─'.repeat(col2 - 2), col2, 'center'),
215
216
  pad('/help — commands · /exit — quit', col2, 'center')
216
217
  ]
217
- // 内容放在中间位置(21行中,从第8行开始放5行内容)
218
- const titleStart = Math.floor((robotLines.length - baseTitleLines.length) / 2)
218
+ // 内容从第2行开始(让分隔线与机器人中间横线对齐)
219
+ const titleStart = 1
219
220
  const titleLines = []
220
221
  for (let i = 0; i < robotLines.length; i++) {
221
222
  const ti = i - titleStart
@@ -235,7 +236,7 @@ function buildBanner({ model, permissionMode, session, maxTokens }) {
235
236
  pad(`Budget: 0 / ${maxTokens ?? 200000}`, col3, 'right'),
236
237
  pad(`Session: ${sessionId?.toString().slice(-6)}`, col3, 'right')
237
238
  ]
238
- const infoStart = Math.floor((robotLines.length - baseInfoLines.length) / 2)
239
+ const infoStart = 1
239
240
  const infoLines = []
240
241
  for (let i = 0; i < robotLines.length; i++) {
241
242
  const ti = i - infoStart