cc-viewer 1.6.257 → 1.6.260
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 +35 -11
- package/dist/assets/{App-CEytutAo.js → App-xdyZgq1g.js} +1 -1
- package/dist/assets/{MdxEditorPanel-D7jwT3Rc.js → MdxEditorPanel-Cvd3ipsr.js} +1 -1
- package/dist/assets/{Mobile-wOi5_C0e.js → Mobile-CGyoUWJ6.js} +1 -1
- package/dist/assets/ProxyModal-Dj1EpOBQ.js +2 -0
- package/dist/assets/index-CPyk72gd.js +2 -0
- package/dist/index.html +1 -1
- package/findcc.js +20 -14
- package/interceptor.js +3 -2
- package/lib/file-api.js +30 -1
- package/lib/interceptor-core.js +3 -2
- package/lib/log-management.js +6 -4
- package/package.json +1 -1
- package/server.js +96 -21
- package/workspace-registry.js +9 -15
- package/dist/assets/ProxyModal-I50f-Uhc.js +0 -2
- package/dist/assets/index-CyW7-jqU.js +0 -2
package/cli.js
CHANGED
|
@@ -202,9 +202,12 @@ function injectCliJs() {
|
|
|
202
202
|
if (content.includes(INJECT_START)) {
|
|
203
203
|
return 'exists';
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
// 保留主导 EOL:若原文件 CRLF,注入完仍 CRLF(否则 split('\n')+join('\n') 会把 Win 文件
|
|
206
|
+
// 一次性转 LF,git/编辑器抱怨混合行尾且对哈希签名敏感的脚本可能失效)。
|
|
207
|
+
const eol = content.includes('\r\n') ? '\r\n' : '\n';
|
|
208
|
+
const lines = content.split(/\r?\n/);
|
|
206
209
|
lines.splice(2, 0, INJECT_BLOCK);
|
|
207
|
-
writeFileSync(cliPath, lines.join(
|
|
210
|
+
writeFileSync(cliPath, lines.join(eol));
|
|
208
211
|
return 'injected';
|
|
209
212
|
}
|
|
210
213
|
|
|
@@ -379,9 +382,16 @@ async function runCliMode(extraClaudeArgs = [], cwd, noOpen = false) {
|
|
|
379
382
|
const url = `${protocol}://127.0.0.1:${port}`;
|
|
380
383
|
if (!noOpen) {
|
|
381
384
|
try {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
+
// URL 含 & 在 cmd.exe 下会被当命令分隔符切断 query;用 spawn 数组传参避免 shell interpolation。
|
|
386
|
+
// Win 上 `start` 是 cmd.exe 内置不是 .exe,必须 shell:true;用 spawn + 数组让 Node 自己 escape。
|
|
387
|
+
// 第二个 arg '""' 是 `start` 的 window-title 占位(否则 start 会把 URL 当 title)。
|
|
388
|
+
const { spawn } = await import('node:child_process');
|
|
389
|
+
if (process.platform === 'win32') {
|
|
390
|
+
spawn('cmd.exe', ['/c', 'start', '""', url], { stdio: 'ignore', detached: true, windowsHide: true }).unref();
|
|
391
|
+
} else {
|
|
392
|
+
const cmd = process.platform === 'darwin' ? 'open' : 'xdg-open';
|
|
393
|
+
spawn(cmd, [url], { stdio: 'ignore', detached: true }).unref();
|
|
394
|
+
}
|
|
385
395
|
} catch {}
|
|
386
396
|
}
|
|
387
397
|
|
|
@@ -469,9 +479,16 @@ async function runSdkMode(extraClaudeArgs = [], cwd, noOpen = false) {
|
|
|
469
479
|
const url = `${protocol}://127.0.0.1:${port}`;
|
|
470
480
|
if (!noOpen) {
|
|
471
481
|
try {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
482
|
+
// URL 含 & 在 cmd.exe 下会被当命令分隔符切断 query;用 spawn 数组传参避免 shell interpolation。
|
|
483
|
+
// Win 上 `start` 是 cmd.exe 内置不是 .exe,必须 shell:true;用 spawn + 数组让 Node 自己 escape。
|
|
484
|
+
// 第二个 arg '""' 是 `start` 的 window-title 占位(否则 start 会把 URL 当 title)。
|
|
485
|
+
const { spawn } = await import('node:child_process');
|
|
486
|
+
if (process.platform === 'win32') {
|
|
487
|
+
spawn('cmd.exe', ['/c', 'start', '""', url], { stdio: 'ignore', detached: true, windowsHide: true }).unref();
|
|
488
|
+
} else {
|
|
489
|
+
const cmd = process.platform === 'darwin' ? 'open' : 'xdg-open';
|
|
490
|
+
spawn(cmd, [url], { stdio: 'ignore', detached: true }).unref();
|
|
491
|
+
}
|
|
475
492
|
} catch {}
|
|
476
493
|
}
|
|
477
494
|
|
|
@@ -533,9 +550,16 @@ async function runCliModeWorkspaceSelector(extraClaudeArgs = [], noOpen = false)
|
|
|
533
550
|
const url = `${wsProtocol}://127.0.0.1:${port}`;
|
|
534
551
|
if (!noOpen) {
|
|
535
552
|
try {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
553
|
+
// URL 含 & 在 cmd.exe 下会被当命令分隔符切断 query;用 spawn 数组传参避免 shell interpolation。
|
|
554
|
+
// Win 上 `start` 是 cmd.exe 内置不是 .exe,必须 shell:true;用 spawn + 数组让 Node 自己 escape。
|
|
555
|
+
// 第二个 arg '""' 是 `start` 的 window-title 占位(否则 start 会把 URL 当 title)。
|
|
556
|
+
const { spawn } = await import('node:child_process');
|
|
557
|
+
if (process.platform === 'win32') {
|
|
558
|
+
spawn('cmd.exe', ['/c', 'start', '""', url], { stdio: 'ignore', detached: true, windowsHide: true }).unref();
|
|
559
|
+
} else {
|
|
560
|
+
const cmd = process.platform === 'darwin' ? 'open' : 'xdg-open';
|
|
561
|
+
spawn(cmd, [url], { stdio: 'ignore', detached: true }).unref();
|
|
562
|
+
}
|
|
539
563
|
} catch {}
|
|
540
564
|
}
|
|
541
565
|
|