cc-viewer 1.4.13 → 1.4.16

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/cli.js CHANGED
@@ -241,12 +241,16 @@ async function runCliMode(extraClaudeArgs = []) {
241
241
 
242
242
  console.log(t('cli.cMode.starting'));
243
243
 
244
+ // 2. 设置 CLI 模式标记(必须在 import proxy.js 之前,
245
+ // 因为 proxy.js → interceptor.js 可能触发 server.js 加载,
246
+ // server.js 的 isCliMode 在模块顶层求值且只执行一次)
247
+ process.env.CCV_CLI_MODE = '1';
248
+
244
249
  // 1. 启动代理
245
250
  const { startProxy } = await import('./proxy.js');
246
251
  const proxyPort = await startProxy();
247
252
 
248
- // 2. 设置 CLI 模式标记,启动 HTTP 服务器
249
- process.env.CCV_CLI_MODE = '1';
253
+ // 3. 启动 HTTP 服务器
250
254
  const serverMod = await import('./server.js');
251
255
 
252
256
  // 等待服务器启动完成