cc-viewer 0.1.2 → 0.1.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.
package/README.md CHANGED
@@ -11,7 +11,7 @@ npm install -g cc-viewer
11
11
  安装完成后运行:
12
12
 
13
13
  ```bash
14
- ccviewer
14
+ ccv
15
15
  ```
16
16
 
17
17
  该命令会自动将监控脚本注入到本地安装的 Claude Code 中。之后正常使用 Claude Code,打开浏览器访问 `http://localhost:7008` 即可查看监控界面。
package/cli.js CHANGED
@@ -26,7 +26,7 @@ try {
26
26
  writeFileSync(cliPath, lines.join('\n'));
27
27
  console.log('✅ CC Viewer 运行成功');
28
28
  }
29
- console.log(`直接运行 claude 就可以看到cc-viewer的本地运行地址,默认是:127.0.0.1:7008`);
29
+ console.log(`直接运行 claude 即可,启动时会显示 cc-viewer 的实际运行地址`);
30
30
  console.log(`如果后续功能失效,请重新执行一次 ccviewer 命令即可`);
31
31
  } catch (err) {
32
32
  if (err.code === 'ENOENT') {
package/interceptor.js CHANGED
@@ -72,10 +72,10 @@ function assembleStreamMessage(events) {
72
72
  if (event.delta.type === 'text_delta' && event.delta.text) {
73
73
  contentBlocks[event.index].text += event.delta.text;
74
74
  } else if (event.delta.type === 'input_json_delta' && event.delta.partial_json) {
75
- if (!contentBlocks[event.index].input) {
76
- contentBlocks[event.index].input = '';
75
+ if (typeof contentBlocks[event.index]._inputJson !== 'string') {
76
+ contentBlocks[event.index]._inputJson = '';
77
77
  }
78
- contentBlocks[event.index].input += event.delta.partial_json;
78
+ contentBlocks[event.index]._inputJson += event.delta.partial_json;
79
79
  } else if (event.delta.type === 'thinking_delta' && event.delta.thinking) {
80
80
  contentBlocks[event.index].thinking += event.delta.thinking;
81
81
  } else if (event.delta.type === 'signature_delta' && event.delta.signature) {
@@ -88,12 +88,13 @@ function assembleStreamMessage(events) {
88
88
  // 内容块结束
89
89
  if (event.index >= 0 && contentBlocks[event.index]) {
90
90
  // 如果是 tool_use 且有累积的 input JSON,尝试解析
91
- if (contentBlocks[event.index].type === 'tool_use' && contentBlocks[event.index].input) {
91
+ if (contentBlocks[event.index].type === 'tool_use' && typeof contentBlocks[event.index]._inputJson === 'string') {
92
92
  try {
93
- contentBlocks[event.index].input = JSON.parse(contentBlocks[event.index].input);
93
+ contentBlocks[event.index].input = JSON.parse(contentBlocks[event.index]._inputJson);
94
94
  } catch {
95
- // 保持字符串形式
95
+ contentBlocks[event.index].input = contentBlocks[event.index]._inputJson;
96
96
  }
97
+ delete contentBlocks[event.index]._inputJson;
97
98
  }
98
99
  }
99
100
  break;
@@ -0,0 +1 @@
1
+ body{margin:0;background-color:#0d0d0d}*{scrollbar-width:thin;scrollbar-color:#3a3a3a #0d0d0d}*::-webkit-scrollbar{width:6px;height:6px}*::-webkit-scrollbar-track{background:#0d0d0d}*::-webkit-scrollbar-thumb{background:#3a3a3a;border-radius:3px}*::-webkit-scrollbar-thumb:hover{background:#555}.diff-view{background:#1a1a2e;border:1px solid #2a2a3e;border-radius:8px;padding:8px 12px}.diff-line-del{background:#ef444426;color:#fca5a5;padding:0 4px}.diff-line-add{background:#22c55e26;color:#86efac;padding:0 4px}.code-highlight{color:#e6edf3}.hl-keyword{color:#ff7b72}.hl-string{color:#a5d6ff}.hl-comment{color:#8b949e;font-style:italic}.hl-number{color:#79c0ff}.hl-linenum{color:#484f58;-webkit-user-select:none;user-select:none}._GzYRV{line-height:1.2;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}._3eOF8{margin-right:5px;font-weight:700}._3eOF8+._3eOF8{margin-left:-5px}._1MFti{cursor:pointer}._f10Tu{font-size:1.2em;margin-right:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none}._1UmXx:after{content:"▸"}._1LId0:after{content:"▾"}._1pNG9{margin-right:5px}._1pNG9:after{content:"...";font-size:.8em}._2IvMF{background:#eee}._2bkNM{margin:0;padding:0 10px}._1BXBN{margin:0;padding:0}._1MGIk{font-weight:600;margin-right:5px;color:#000}._3uHL6{color:#000}._2T6PJ,._1Gho6{color:#df113a}._vGjyY{color:#2a3f3c}._1bQdo{color:#0b75f5}._3zQKs{color:#469038}._1xvuR{color:#43413d}._oLqym,._2AXVT,._2KJWg{color:#000}._11RoI{background:#002b36}._17H2C,._3QHg2,._3fDAz{color:#fdf6e3}._2bSDX{font-weight:bolder;margin-right:5px;color:#fdf6e3}._gsbQL{color:#fdf6e3}._LaAZe,._GTKgm{color:#81b5ac}._Chy1W{color:#cb4b16}._2bveF{color:#d33682}._2vRm-{color:#ae81ff}._1prJR{color:#268bd2}