cc-insight 0.1.0 → 0.1.2
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 +3 -1
- package/README.zh.md +3 -1
- package/package.json +2 -2
- package/public/js/insights.js +3 -3
- package/public/js/overview.js +27 -15
- package/src/classifiers/topic-rules.js +1 -1
- package/public/js/charts.js +0 -0
- package/public/js/heatmap.js +0 -0
package/README.md
CHANGED
|
@@ -41,11 +41,13 @@ CC Insight indexes your local session history and presents it as an interactive
|
|
|
41
41
|
|
|
42
42
|
**MCP Servers** — Configured servers and their tools, parsed from `settings.json` and `claude_desktop_config.json`.
|
|
43
43
|
|
|
44
|
+
<img width="2874" height="1548" alt="image" src="https://github.com/user-attachments/assets/b6a34467-13a3-4c5a-957a-263ec4d1dbe2" />
|
|
45
|
+
|
|
44
46
|
---
|
|
45
47
|
|
|
46
48
|
## Requirements
|
|
47
49
|
|
|
48
|
-
- Node.js ≥ 20
|
|
50
|
+
- Node.js ≥ 20 (LTS recommended: 20, 22, or 24)
|
|
49
51
|
- Claude Code installed (`~/.claude/` directory must exist)
|
|
50
52
|
|
|
51
53
|
---
|
package/README.zh.md
CHANGED
|
@@ -41,11 +41,13 @@ CC Insight 把你本地的对话历史建立索引,以交互式仪表盘的形
|
|
|
41
41
|
|
|
42
42
|
**MCP Server** — 自动读取配置文件,展示已配置的 MCP Server 及工具列表。
|
|
43
43
|
|
|
44
|
+
<img width="2874" height="1548" alt="image" src="https://github.com/user-attachments/assets/cdca4f24-8a4b-40f2-b004-0474422412f7" />
|
|
45
|
+
|
|
44
46
|
---
|
|
45
47
|
|
|
46
48
|
## 环境要求
|
|
47
49
|
|
|
48
|
-
- Node.js ≥ 20
|
|
50
|
+
- Node.js ≥ 20(推荐 LTS 版本:20、22 或 24)
|
|
49
51
|
- 已安装并使用过 Claude Code(`~/.claude/` 目录存在)
|
|
50
52
|
|
|
51
53
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-insight",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Local Claude Code usage dashboard — sessions, skills, efficiency, MCP servers, and shareable poster",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"test": "node --experimental-vm-modules node_modules/.bin/jest --testPathPattern=tests/"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"better-sqlite3": "^
|
|
36
|
+
"better-sqlite3": "^12.8.0",
|
|
37
37
|
"chokidar": "^3.6.0",
|
|
38
38
|
"express": "^4.19.0",
|
|
39
39
|
"open": "^10.1.0",
|
package/public/js/insights.js
CHANGED
|
@@ -3,7 +3,7 @@ import { setRange } from './app.js'
|
|
|
3
3
|
|
|
4
4
|
const TOPIC_COLORS = {
|
|
5
5
|
'调试修复': 'var(--green)',
|
|
6
|
-
'
|
|
6
|
+
'功能开发': 'var(--cyan)',
|
|
7
7
|
'架构设计': 'var(--amber)',
|
|
8
8
|
'代码重构': 'var(--purple)',
|
|
9
9
|
'学习探索': 'var(--red)',
|
|
@@ -15,7 +15,7 @@ const TOPIC_COLORS = {
|
|
|
15
15
|
// 热力图用 rgba,支持按强度调节透明度
|
|
16
16
|
const TOPIC_HEX = {
|
|
17
17
|
'调试修复': '74,222,128',
|
|
18
|
-
'
|
|
18
|
+
'功能开发': '34,211,238',
|
|
19
19
|
'架构设计': '245,158,11',
|
|
20
20
|
'代码重构': '167,139,250',
|
|
21
21
|
'学习探索': '248,113,113',
|
|
@@ -296,7 +296,7 @@ function renderOutliers(el, rows) {
|
|
|
296
296
|
${preview}
|
|
297
297
|
</div>
|
|
298
298
|
</div>`
|
|
299
|
-
}, '
|
|
299
|
+
}, '暂无数据')
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
// ── 项目分布 ──
|
package/public/js/overview.js
CHANGED
|
@@ -252,7 +252,11 @@ function renderDist(el, data) {
|
|
|
252
252
|
col.addEventListener('mouseenter', () => { tip.textContent = col.dataset.label; tip.style.opacity = '1' })
|
|
253
253
|
col.addEventListener('mouseleave', () => { tip.style.opacity = '0' })
|
|
254
254
|
col.addEventListener('mousemove', e => {
|
|
255
|
-
|
|
255
|
+
const tipW = tip.offsetWidth || 120
|
|
256
|
+
const left = e.clientX + 12 + tipW > window.innerWidth
|
|
257
|
+
? e.clientX - tipW - 8
|
|
258
|
+
: e.clientX + 12
|
|
259
|
+
tip.style.left = left + 'px'
|
|
256
260
|
tip.style.top = (e.clientY - 24) + 'px'
|
|
257
261
|
})
|
|
258
262
|
})
|
|
@@ -359,20 +363,28 @@ function renderToolDist(el, data) {
|
|
|
359
363
|
|
|
360
364
|
// SVG 环形图
|
|
361
365
|
const R = 54, r = 32, cx = 70, cy = 70
|
|
362
|
-
let
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
366
|
+
let paths
|
|
367
|
+
if (items.length === 1) {
|
|
368
|
+
// 单项无法用 arc path 画完整圆,用两个同心圆代替
|
|
369
|
+
const color = COLORS[0]
|
|
370
|
+
paths = `<circle cx="${cx}" cy="${cy}" r="${R}" fill="${color}" opacity="0.9"/>
|
|
371
|
+
<circle cx="${cx}" cy="${cy}" r="${r}" fill="var(--bg1)"/>`
|
|
372
|
+
} else {
|
|
373
|
+
let angle = -Math.PI / 2
|
|
374
|
+
paths = items.map((item, i) => {
|
|
375
|
+
const pct = item.count / total
|
|
376
|
+
const sweep = pct * 2 * Math.PI
|
|
377
|
+
const x1 = cx + R * Math.cos(angle), y1 = cy + R * Math.sin(angle)
|
|
378
|
+
const x2 = cx + R * Math.cos(angle + sweep), y2 = cy + R * Math.sin(angle + sweep)
|
|
379
|
+
const ix1 = cx + r * Math.cos(angle), iy1 = cy + r * Math.sin(angle)
|
|
380
|
+
const ix2 = cx + r * Math.cos(angle + sweep), iy2 = cy + r * Math.sin(angle + sweep)
|
|
381
|
+
const large = sweep > Math.PI ? 1 : 0
|
|
382
|
+
const color = i < COLORS.length ? COLORS[i] : 'var(--muted)'
|
|
383
|
+
const d = `M${x1},${y1} A${R},${R},0,${large},1,${x2},${y2} L${ix2},${iy2} A${r},${r},0,${large},0,${ix1},${iy1} Z`
|
|
384
|
+
angle += sweep
|
|
385
|
+
return `<path d="${d}" fill="${color}" opacity="0.9"/>`
|
|
386
|
+
}).join('')
|
|
387
|
+
}
|
|
376
388
|
|
|
377
389
|
const totalFmt = total >= 10000 ? (total / 10000).toFixed(1) + 'w次' : total.toLocaleString() + '次'
|
|
378
390
|
|
|
@@ -8,7 +8,7 @@ export const TOPIC_RULES = [
|
|
|
8
8
|
'traceback', 'stacktrace', '调试', 'debug', 'broken', 'not working'],
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
topic: '
|
|
11
|
+
topic: '功能开发',
|
|
12
12
|
keywords: ['新增', 'implement', 'feature', '功能', ' add ', 'build', '做一个', '开发',
|
|
13
13
|
'实现', '支持', '创建', 'create', '添加', '增加', 'develop', 'new feature'],
|
|
14
14
|
},
|
package/public/js/charts.js
DELETED
|
File without changes
|
package/public/js/heatmap.js
DELETED
|
File without changes
|