@lim324/my-claude-code-viewer 0.0.1
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 +80 -0
- package/bin/my-claude-code-viewer +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cost-calculator.d.ts +25 -0
- package/dist/lib/cost-calculator.d.ts.map +1 -0
- package/dist/lib/cost-calculator.js +75 -0
- package/dist/lib/cost-calculator.js.map +1 -0
- package/dist/lib/jsonl-parser.d.ts +47 -0
- package/dist/lib/jsonl-parser.d.ts.map +1 -0
- package/dist/lib/jsonl-parser.js +68 -0
- package/dist/lib/jsonl-parser.js.map +1 -0
- package/dist/lib/pricing.d.ts +47 -0
- package/dist/lib/pricing.d.ts.map +1 -0
- package/dist/lib/pricing.js +119 -0
- package/dist/lib/pricing.js.map +1 -0
- package/dist/routes/api.d.ts +4 -0
- package/dist/routes/api.d.ts.map +1 -0
- package/dist/routes/api.js +103 -0
- package/dist/routes/api.js.map +1 -0
- package/dist/routes/views.d.ts +4 -0
- package/dist/routes/views.d.ts.map +1 -0
- package/dist/routes/views.js +737 -0
- package/dist/routes/views.js.map +1 -0
- package/dist/server/project-scanner.d.ts +63 -0
- package/dist/server/project-scanner.d.ts.map +1 -0
- package/dist/server/project-scanner.js +220 -0
- package/dist/server/project-scanner.js.map +1 -0
- package/dist/server/session-analyzer.d.ts +42 -0
- package/dist/server/session-analyzer.d.ts.map +1 -0
- package/dist/server/session-analyzer.js +185 -0
- package/dist/server/session-analyzer.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const express_1 = require("express");
|
|
4
|
+
const project_scanner_1 = require("../server/project-scanner");
|
|
5
|
+
const session_analyzer_1 = require("../server/session-analyzer");
|
|
6
|
+
const router = (0, express_1.Router)();
|
|
7
|
+
/**
|
|
8
|
+
* GET /api/stats
|
|
9
|
+
* Get global statistics
|
|
10
|
+
*/
|
|
11
|
+
router.get("/stats", (req, res) => {
|
|
12
|
+
try {
|
|
13
|
+
const stats = (0, project_scanner_1.getGlobalStats)();
|
|
14
|
+
res.json({
|
|
15
|
+
success: true,
|
|
16
|
+
data: stats,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
res.status(500).json({
|
|
21
|
+
success: false,
|
|
22
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* GET /api/projects
|
|
28
|
+
* Get all projects
|
|
29
|
+
*/
|
|
30
|
+
router.get("/projects", (req, res) => {
|
|
31
|
+
try {
|
|
32
|
+
const projects = (0, project_scanner_1.scanProjects)();
|
|
33
|
+
res.json({
|
|
34
|
+
success: true,
|
|
35
|
+
data: projects,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
res.status(500).json({
|
|
40
|
+
success: false,
|
|
41
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* GET /api/projects/:id
|
|
47
|
+
* Get project details with sessions
|
|
48
|
+
*/
|
|
49
|
+
router.get("/projects/:id", (req, res) => {
|
|
50
|
+
try {
|
|
51
|
+
const project = (0, project_scanner_1.getProjectDetail)(req.params.id);
|
|
52
|
+
if (!project) {
|
|
53
|
+
return res.status(404).json({
|
|
54
|
+
success: false,
|
|
55
|
+
error: "Project not found",
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
res.json({
|
|
59
|
+
success: true,
|
|
60
|
+
data: project,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
res.status(500).json({
|
|
65
|
+
success: false,
|
|
66
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* GET /api/projects/:projectId/sessions/:sessionId
|
|
72
|
+
* Get session details
|
|
73
|
+
*/
|
|
74
|
+
router.get("/projects/:projectId/sessions/:sessionId", (req, res) => {
|
|
75
|
+
try {
|
|
76
|
+
const projectPath = (0, project_scanner_1.getSafeProjectPath)(req.params.projectId);
|
|
77
|
+
if (!projectPath) {
|
|
78
|
+
return res.status(404).json({
|
|
79
|
+
success: false,
|
|
80
|
+
error: "Invalid project",
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const session = (0, session_analyzer_1.getSessionDetail)(req.params.projectId, req.params.sessionId, projectPath);
|
|
84
|
+
if (!session) {
|
|
85
|
+
return res.status(404).json({
|
|
86
|
+
success: false,
|
|
87
|
+
error: "Session not found",
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
res.json({
|
|
91
|
+
success: true,
|
|
92
|
+
data: session,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
res.status(500).json({
|
|
97
|
+
success: false,
|
|
98
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
exports.default = router;
|
|
103
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/routes/api.ts"],"names":[],"mappings":";;AAAA,qCAAiC;AACjC,+DAKmC;AACnC,iEAEoC;AAEpC,MAAM,MAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAChC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAA,gCAAc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