cc-viewer 1.4.11 → 1.4.13

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/dist/index.html CHANGED
@@ -6,8 +6,8 @@
6
6
  <title>Claude Code Viewer</title>
7
7
  <link rel="icon" href="/favicon.ico?v=1">
8
8
  <link rel="shortcut icon" href="/favicon.ico?v=1">
9
- <script type="module" crossorigin src="/assets/index-7tdB1QJS.js"></script>
10
- <link rel="stylesheet" crossorigin href="/assets/index-DZrvl093.css">
9
+ <script type="module" crossorigin src="/assets/index-B3PatjPN.js"></script>
10
+ <link rel="stylesheet" crossorigin href="/assets/index-ADbGFOYO.css">
11
11
  </head>
12
12
  <body>
13
13
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.4.11",
3
+ "version": "1.4.13",
4
4
  "description": "Claude Code Logger visualization management tool",
5
5
  "license": "MIT",
6
6
  "main": "server.js",
@@ -59,6 +59,7 @@
59
59
  "devDependencies": {
60
60
  "@vitejs/plugin-react": "^4.5.2",
61
61
  "@xterm/addon-fit": "^0.11.0",
62
+ "@xterm/addon-webgl": "^0.19.0",
62
63
  "@xterm/xterm": "^6.0.0",
63
64
  "antd": "^5.29.2",
64
65
  "diff": "^8.0.3",
package/server.js CHANGED
@@ -602,7 +602,7 @@ function handleRequest(req, res) {
602
602
  if (url === '/api/git-status' && method === 'GET') {
603
603
  try {
604
604
  const cwd = process.env.CCV_PROJECT_DIR || process.cwd();
605
- const output = execSync('git status --porcelain', { cwd, encoding: 'utf-8', timeout: 5000 });
605
+ const output = execSync('git status --porcelain', { cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'] });
606
606
  const lines = output.split('\n').filter(line => line.trim());
607
607
  const changes = lines.map(line => {
608
608
  const status = line.substring(0, 2).trim();
@@ -638,21 +638,23 @@ function handleRequest(req, res) {
638
638
  if (file.includes('..') || file.startsWith('/')) continue;
639
639
 
640
640
  try {
641
- const statusOutput = execSync(`git status --porcelain "${file}"`, { cwd, encoding: 'utf-8', timeout: 3000 });
641
+ const statusOutput = execSync(`git status --porcelain -- "${file}"`, { cwd, encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'] });
642
642
  if (!statusOutput.trim()) continue;
643
643
 
644
644
  const status = statusOutput.substring(0, 2).trim();
645
645
  const is_new = status === 'A' || status === '??';
646
646
  const is_deleted = status === 'D';
647
647
 
648
- // 检查是否为二进制文件
648
+ // 检查是否为二进制文件(已删除文件跳过)
649
649
  let is_binary = false;
650
- try {
651
- const diffCheck = execSync(`git diff --numstat HEAD "${file}"`, { cwd, encoding: 'utf-8', timeout: 3000 });
652
- if (diffCheck.includes('-\t-\t')) {
653
- is_binary = true;
654
- }
655
- } catch {}
650
+ if (!is_deleted) {
651
+ try {
652
+ const diffCheck = execSync(`git diff --numstat HEAD -- "${file}"`, { cwd, encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'] });
653
+ if (diffCheck.includes('-\t-\t')) {
654
+ is_binary = true;
655
+ }
656
+ } catch {}
657
+ }
656
658
 
657
659
  let old_content = '';
658
660
  let new_content = '';
@@ -661,7 +663,7 @@ function handleRequest(req, res) {
661
663
  // 获取旧内容(HEAD 版本)
662
664
  if (!is_new) {
663
665
  try {
664
- old_content = execSync(`git show HEAD:"${file}"`, { cwd, encoding: 'utf-8', timeout: 5000, maxBuffer: 5 * 1024 * 1024 });
666
+ old_content = execSync(`git show HEAD:"${file}"`, { cwd, encoding: 'utf-8', timeout: 5000, maxBuffer: 5 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'] });
665
667
  } catch {
666
668
  old_content = '';
667
669
  }