@qiaolei81/copilot-session-viewer 0.3.3 → 0.3.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.
Files changed (60) hide show
  1. package/bin/copilot-session-viewer +2 -2
  2. package/dist/server.min.js +99 -0
  3. package/package.json +14 -3
  4. package/public/vendor/marked.umd.min.js +8 -0
  5. package/public/vendor/purify.min.js +3 -0
  6. package/public/vendor/vue-virtual-scroller.css +1 -0
  7. package/public/vendor/vue-virtual-scroller.min.js +2 -0
  8. package/public/vendor/vue.global.prod.min.js +19 -0
  9. package/views/session-vue.ejs +5 -5
  10. package/views/time-analyze.ejs +2 -2
  11. package/.nycrc +0 -29
  12. package/AGENTS.md +0 -109
  13. package/CHANGELOG.md +0 -313
  14. package/CONTRIBUTING.md +0 -104
  15. package/RELEASE.md +0 -146
  16. package/docs/API.md +0 -471
  17. package/docs/DEVELOPMENT.md +0 -556
  18. package/docs/INSTALLATION.md +0 -329
  19. package/docs/README.md +0 -102
  20. package/docs/TROUBLESHOOTING.md +0 -630
  21. package/docs/images/homepage.png +0 -0
  22. package/docs/images/session-detail.png +0 -0
  23. package/docs/images/time-analysis.png +0 -0
  24. package/docs/unified-event-format-design.md +0 -844
  25. package/docs/unified-event-format-implementation.md +0 -350
  26. package/eslint.config.mjs +0 -133
  27. package/examples/parser-usage.js +0 -114
  28. package/lib/parsers/README.md +0 -239
  29. package/lib/parsers/base-parser.js +0 -53
  30. package/lib/parsers/claude-parser.js +0 -181
  31. package/lib/parsers/copilot-parser.js +0 -143
  32. package/lib/parsers/index.js +0 -15
  33. package/lib/parsers/parser-factory.js +0 -77
  34. package/lib/parsers/pi-mono-parser.js +0 -119
  35. package/lib/parsers/vscode-parser.js +0 -591
  36. package/scripts/release.sh +0 -43
  37. package/server.js +0 -29
  38. package/src/app.js +0 -129
  39. package/src/config/index.js +0 -27
  40. package/src/controllers/insightController.js +0 -136
  41. package/src/controllers/sessionController.js +0 -449
  42. package/src/controllers/tagController.js +0 -113
  43. package/src/controllers/uploadController.js +0 -648
  44. package/src/middleware/common.js +0 -67
  45. package/src/middleware/rateLimiting.js +0 -62
  46. package/src/models/Session.js +0 -146
  47. package/src/routes/api.js +0 -11
  48. package/src/routes/insights.js +0 -12
  49. package/src/routes/pages.js +0 -12
  50. package/src/routes/uploads.js +0 -14
  51. package/src/schemas/event.schema.js +0 -73
  52. package/src/services/eventNormalizer.js +0 -291
  53. package/src/services/insightService.js +0 -535
  54. package/src/services/sessionRepository.js +0 -1092
  55. package/src/services/sessionService.js +0 -1919
  56. package/src/services/tagService.js +0 -205
  57. package/src/telemetry.js +0 -152
  58. package/src/utils/fileUtils.js +0 -305
  59. package/src/utils/helpers.js +0 -45
  60. package/src/utils/processManager.js +0 -85
@@ -1,85 +0,0 @@
1
- /**
2
- * Process Manager - Track and cleanup spawned processes
3
- */
4
-
5
- class ProcessManager {
6
- constructor() {
7
- this.activeProcesses = new Set();
8
- this.isShuttingDown = false;
9
- this._setupCleanupHandlers();
10
- }
11
-
12
- /**
13
- * Register a new process for tracking
14
- * @param {ChildProcess} process - The spawned process
15
- * @param {Object} metadata - Optional metadata for logging
16
- */
17
- register(process, metadata = {}) {
18
- const processInfo = { process, metadata, startTime: Date.now() };
19
- this.activeProcesses.add(processInfo);
20
-
21
- process.on('exit', () => {
22
- this.activeProcesses.delete(processInfo);
23
- const duration = Date.now() - processInfo.startTime;
24
- console.log(`šŸ”„ Process exited (${metadata.name || 'unknown'}): ${duration}ms`);
25
- });
26
-
27
- return processInfo;
28
- }
29
-
30
- /**
31
- * Kill all active processes
32
- */
33
- killAll() {
34
- console.log(`šŸ›‘ Killing ${this.activeProcesses.size} active processes...`);
35
-
36
- for (const { process, metadata } of this.activeProcesses) {
37
- try {
38
- if (!process.killed) {
39
- process.kill('SIGTERM');
40
- console.log(` āœ“ Killed ${metadata.name || process.pid}`);
41
- }
42
- } catch (err) {
43
- console.error(` āœ— Failed to kill ${metadata.name || process.pid}:`, err.message);
44
- }
45
- }
46
-
47
- this.activeProcesses.clear();
48
- }
49
-
50
- /**
51
- * Get count of active processes
52
- */
53
- getActiveCount() {
54
- return this.activeProcesses.size;
55
- }
56
-
57
- /**
58
- * Setup cleanup handlers for graceful shutdown
59
- */
60
- _setupCleanupHandlers() {
61
- const cleanup = (signal, exitCode = 0) => {
62
- if (this.isShuttingDown) return;
63
- this.isShuttingDown = true;
64
-
65
- console.log(`\nšŸ“› Received ${signal}, shutting down gracefully...`);
66
- this.killAll();
67
-
68
- // Give processes time to exit
69
- setTimeout(() => {
70
- process.exit(exitCode);
71
- }, 1000);
72
- };
73
-
74
- process.on('SIGTERM', () => cleanup('SIGTERM', 0));
75
- process.on('SIGINT', () => cleanup('SIGINT', 0));
76
-
77
- // Handle uncaught errors with error exit code
78
- process.on('uncaughtException', (err) => {
79
- console.error('šŸ’„ Uncaught exception:', err);
80
- cleanup('uncaughtException', 1);
81
- });
82
- }
83
- }
84
-
85
- module.exports = new ProcessManager();