cc-viewer 1.4.28 → 1.4.30

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,7 +6,7 @@
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-CEQ4SgLV.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-DLV-mlQZ.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-BTtdvNJL.css">
11
11
  </head>
12
12
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.4.28",
3
+ "version": "1.4.30",
4
4
  "description": "Claude Code Logger visualization management tool",
5
5
  "license": "MIT",
6
6
  "main": "server.js",
@@ -59,6 +59,8 @@
59
59
  "devDependencies": {
60
60
  "@vitejs/plugin-react": "^4.5.2",
61
61
  "@xterm/addon-fit": "^0.11.0",
62
+ "@xterm/addon-unicode11": "^0.9.0",
63
+ "@xterm/addon-web-links": "^0.12.0",
62
64
  "@xterm/addon-webgl": "^0.19.0",
63
65
  "@xterm/xterm": "^6.0.0",
64
66
  "antd": "^5.29.2",
@@ -72,7 +74,6 @@
72
74
  "vite": "^6.3.5"
73
75
  },
74
76
  "dependencies": {
75
- "@xterm/addon-web-links": "^0.12.0",
76
77
  "chokidar": "^5.0.0",
77
78
  "node-pty": "^1.1.0",
78
79
  "undici": "^7.22.0",
package/pty-manager.js CHANGED
@@ -11,6 +11,18 @@ let lastExitCode = null;
11
11
  let outputBuffer = '';
12
12
  let currentWorkspacePath = null;
13
13
  const MAX_BUFFER = 200000;
14
+ let batchBuffer = '';
15
+ let batchScheduled = false;
16
+
17
+ function flushBatch() {
18
+ batchScheduled = false;
19
+ if (!batchBuffer) return;
20
+ const chunk = batchBuffer;
21
+ batchBuffer = '';
22
+ for (const cb of dataListeners) {
23
+ try { cb(chunk); } catch {}
24
+ }
25
+ }
14
26
 
15
27
  function fixSpawnHelperPermissions() {
16
28
  try {
@@ -77,12 +89,15 @@ export async function spawnClaude(proxyPort, cwd, extraArgs = [], claudePath = n
77
89
  if (outputBuffer.length > MAX_BUFFER) {
78
90
  outputBuffer = outputBuffer.slice(-MAX_BUFFER);
79
91
  }
80
- for (const cb of dataListeners) {
81
- try { cb(data); } catch {}
92
+ batchBuffer += data;
93
+ if (!batchScheduled) {
94
+ batchScheduled = true;
95
+ setImmediate(flushBatch);
82
96
  }
83
97
  });
84
98
 
85
99
  ptyProcess.onExit(({ exitCode }) => {
100
+ flushBatch();
86
101
  lastExitCode = exitCode;
87
102
  ptyProcess = null;
88
103
  currentWorkspacePath = null;
@@ -108,6 +123,9 @@ export function resizePty(cols, rows) {
108
123
 
109
124
  export function killPty() {
110
125
  if (ptyProcess) {
126
+ flushBatch();
127
+ batchBuffer = '';
128
+ batchScheduled = false;
111
129
  try { ptyProcess.kill(); } catch {}
112
130
  ptyProcess = null;
113
131
  }
package/server.js CHANGED
@@ -521,6 +521,14 @@ async function handleRequest(req, res) {
521
521
  } catch {}
522
522
  });
523
523
 
524
+ // 发送 full_reload 以刷新会话区域
525
+ const entries = readLogFile();
526
+ clients.forEach(client => {
527
+ try {
528
+ client.write(`event: full_reload\ndata: ${JSON.stringify(entries)}\n\n`);
529
+ } catch {}
530
+ });
531
+
524
532
  res.writeHead(200, { 'Content-Type': 'application/json' });
525
533
  res.end(JSON.stringify({ ok: true, projectName: result.projectName }));
526
534
  } catch (err) {