devlensio 0.2.0

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 (136) hide show
  1. package/LICENSE +674 -0
  2. package/dist/clustering/index.d.ts +27 -0
  3. package/dist/clustering/index.js +149 -0
  4. package/dist/config/index.d.ts +10 -0
  5. package/dist/config/index.js +78 -0
  6. package/dist/config/providers/file.d.ts +19 -0
  7. package/dist/config/providers/file.js +215 -0
  8. package/dist/config/providers/request.d.ts +2 -0
  9. package/dist/config/providers/request.js +72 -0
  10. package/dist/config/types.d.ts +46 -0
  11. package/dist/config/types.js +81 -0
  12. package/dist/config/writer.d.ts +29 -0
  13. package/dist/config/writer.js +103 -0
  14. package/dist/filesystem/appRouter.d.ts +2 -0
  15. package/dist/filesystem/appRouter.js +126 -0
  16. package/dist/filesystem/backendRoutes.d.ts +2 -0
  17. package/dist/filesystem/backendRoutes.js +161 -0
  18. package/dist/filesystem/index.d.ts +2 -0
  19. package/dist/filesystem/index.js +28 -0
  20. package/dist/filesystem/index.test.d.ts +1 -0
  21. package/dist/filesystem/index.test.js +178 -0
  22. package/dist/filesystem/pagesRouter.d.ts +2 -0
  23. package/dist/filesystem/pagesRouter.js +109 -0
  24. package/dist/fingerprint/detectors.d.ts +8 -0
  25. package/dist/fingerprint/detectors.js +174 -0
  26. package/dist/fingerprint/index.d.ts +2 -0
  27. package/dist/fingerprint/index.js +41 -0
  28. package/dist/fingerprint/index.test.d.ts +1 -0
  29. package/dist/fingerprint/index.test.js +148 -0
  30. package/dist/graph/buildLookup.d.ts +10 -0
  31. package/dist/graph/buildLookup.js +32 -0
  32. package/dist/graph/edges/callEdges.d.ts +7 -0
  33. package/dist/graph/edges/callEdges.js +145 -0
  34. package/dist/graph/edges/eventEdges.d.ts +7 -0
  35. package/dist/graph/edges/eventEdges.js +203 -0
  36. package/dist/graph/edges/guardEdges.d.ts +3 -0
  37. package/dist/graph/edges/guardEdges.js +232 -0
  38. package/dist/graph/edges/hookEdges.d.ts +3 -0
  39. package/dist/graph/edges/hookEdges.js +54 -0
  40. package/dist/graph/edges/importEdges.d.ts +8 -0
  41. package/dist/graph/edges/importEdges.js +224 -0
  42. package/dist/graph/edges/propEdges.d.ts +3 -0
  43. package/dist/graph/edges/propEdges.js +142 -0
  44. package/dist/graph/edges/routeEdge.d.ts +3 -0
  45. package/dist/graph/edges/routeEdge.js +124 -0
  46. package/dist/graph/edges/stateEdges.d.ts +3 -0
  47. package/dist/graph/edges/stateEdges.js +206 -0
  48. package/dist/graph/edges/testEdges.d.ts +3 -0
  49. package/dist/graph/edges/testEdges.js +143 -0
  50. package/dist/graph/edges/utils.d.ts +2 -0
  51. package/dist/graph/edges/utils.js +25 -0
  52. package/dist/graph/index.d.ts +6 -0
  53. package/dist/graph/index.js +65 -0
  54. package/dist/graph/index.test.d.ts +1 -0
  55. package/dist/graph/index.test.js +542 -0
  56. package/dist/graph/thirdPartyLibs.d.ts +8 -0
  57. package/dist/graph/thirdPartyLibs.js +162 -0
  58. package/dist/index.d.ts +15 -0
  59. package/dist/index.js +15 -0
  60. package/dist/jobs/index.d.ts +5 -0
  61. package/dist/jobs/index.js +11 -0
  62. package/dist/jobs/queue/interface.d.ts +13 -0
  63. package/dist/jobs/queue/interface.js +1 -0
  64. package/dist/jobs/queue/memory.d.ts +24 -0
  65. package/dist/jobs/queue/memory.js +291 -0
  66. package/dist/jobs/runner.d.ts +3 -0
  67. package/dist/jobs/runner.js +136 -0
  68. package/dist/jobs/types.d.ts +112 -0
  69. package/dist/jobs/types.js +33 -0
  70. package/dist/parser/directives.d.ts +4 -0
  71. package/dist/parser/directives.js +31 -0
  72. package/dist/parser/extractors/components.d.ts +5 -0
  73. package/dist/parser/extractors/components.js +240 -0
  74. package/dist/parser/extractors/functions.d.ts +4 -0
  75. package/dist/parser/extractors/functions.js +240 -0
  76. package/dist/parser/extractors/hooks.d.ts +4 -0
  77. package/dist/parser/extractors/hooks.js +128 -0
  78. package/dist/parser/extractors/stores.d.ts +3 -0
  79. package/dist/parser/extractors/stores.js +181 -0
  80. package/dist/parser/index.d.ts +14 -0
  81. package/dist/parser/index.js +168 -0
  82. package/dist/parser/index.test.d.ts +1 -0
  83. package/dist/parser/index.test.js +319 -0
  84. package/dist/parser/typeUtils.d.ts +9 -0
  85. package/dist/parser/typeUtils.js +46 -0
  86. package/dist/pipeline/index.d.ts +50 -0
  87. package/dist/pipeline/index.js +249 -0
  88. package/dist/scoring/connectionCounter.d.ts +28 -0
  89. package/dist/scoring/connectionCounter.js +134 -0
  90. package/dist/scoring/fileScorer.d.ts +2 -0
  91. package/dist/scoring/fileScorer.js +44 -0
  92. package/dist/scoring/index.d.ts +22 -0
  93. package/dist/scoring/index.js +130 -0
  94. package/dist/scoring/index.test.d.ts +1 -0
  95. package/dist/scoring/index.test.js +453 -0
  96. package/dist/scoring/nodeScorer.d.ts +3 -0
  97. package/dist/scoring/nodeScorer.js +108 -0
  98. package/dist/scoring/noiseFilter.d.ts +18 -0
  99. package/dist/scoring/noiseFilter.js +92 -0
  100. package/dist/storage/fileStorage.d.ts +117 -0
  101. package/dist/storage/fileStorage.js +616 -0
  102. package/dist/storage/index.d.ts +4 -0
  103. package/dist/storage/index.js +2 -0
  104. package/dist/storage/interface.d.ts +27 -0
  105. package/dist/storage/interface.js +1 -0
  106. package/dist/summarizer/checkpoint.d.ts +15 -0
  107. package/dist/summarizer/checkpoint.js +110 -0
  108. package/dist/summarizer/index.d.ts +2 -0
  109. package/dist/summarizer/index.js +281 -0
  110. package/dist/summarizer/mapreduce.d.ts +4 -0
  111. package/dist/summarizer/mapreduce.js +87 -0
  112. package/dist/summarizer/prompts.d.ts +22 -0
  113. package/dist/summarizer/prompts.js +205 -0
  114. package/dist/summarizer/providers/anthropic.d.ts +9 -0
  115. package/dist/summarizer/providers/anthropic.js +78 -0
  116. package/dist/summarizer/providers/gemini.d.ts +9 -0
  117. package/dist/summarizer/providers/gemini.js +79 -0
  118. package/dist/summarizer/providers/index.d.ts +3 -0
  119. package/dist/summarizer/providers/index.js +43 -0
  120. package/dist/summarizer/providers/ollama.d.ts +9 -0
  121. package/dist/summarizer/providers/ollama.js +23 -0
  122. package/dist/summarizer/providers/openRouter.d.ts +9 -0
  123. package/dist/summarizer/providers/openRouter.js +19 -0
  124. package/dist/summarizer/providers/openai.d.ts +9 -0
  125. package/dist/summarizer/providers/openai.js +72 -0
  126. package/dist/summarizer/providers/types.d.ts +32 -0
  127. package/dist/summarizer/providers/types.js +1 -0
  128. package/dist/summarizer/retry.d.ts +7 -0
  129. package/dist/summarizer/retry.js +51 -0
  130. package/dist/summarizer/topological.d.ts +3 -0
  131. package/dist/summarizer/topological.js +105 -0
  132. package/dist/summarizer/types.d.ts +57 -0
  133. package/dist/summarizer/types.js +17 -0
  134. package/dist/types.d.ts +78 -0
  135. package/dist/types.js +1 -0
  136. package/package.json +48 -0
@@ -0,0 +1,117 @@
1
+ import type { PipelineResult, PipelineStats } from "../pipeline/index.js";
2
+ import type { CodeNode, CodeEdge } from "../types.js";
3
+ import type { GraphStorage } from "./interface.js";
4
+ export interface GraphIndexEntry {
5
+ graphId: string;
6
+ repoPath: string;
7
+ isGithubRepo: boolean;
8
+ githubUrl: string | null;
9
+ framework: string;
10
+ language: string;
11
+ latestCommit: string;
12
+ latestAnalyzedAt: string;
13
+ commitCount: number;
14
+ }
15
+ export interface CommitSummary {
16
+ commitHash: string;
17
+ branch: string;
18
+ message: string;
19
+ analyzedAt: string;
20
+ nodeCount: number;
21
+ edgeCount: number;
22
+ hasGit: boolean;
23
+ isSummarized?: boolean;
24
+ }
25
+ export interface GraphMeta {
26
+ graphId: string;
27
+ repoPath: string;
28
+ isGithubRepo: boolean;
29
+ githubUrl: string | null;
30
+ githubOwner: string | null;
31
+ githubRepo: string | null;
32
+ fingerprint: PipelineResult["fingerprint"];
33
+ routes: PipelineResult["routes"];
34
+ commits: CommitSummary[];
35
+ summarizedCommits: string[];
36
+ }
37
+ export interface CommitData {
38
+ commitHash: string;
39
+ analyzedAt: string;
40
+ nodes: CodeNode[];
41
+ edges: CodeEdge[];
42
+ allNodes: CodeNode[];
43
+ allEdges: CodeEdge[];
44
+ nodeScores: Record<string, number>;
45
+ stats: PipelineStats;
46
+ }
47
+ export interface NodeDiff {
48
+ added: DiffNode[];
49
+ removed: DiffNode[];
50
+ codeChanged: DiffNode[];
51
+ scoreChanged: ScoreChange[];
52
+ edgesChanged: EdgeChange[];
53
+ moved: MovedNode[];
54
+ unchanged: number;
55
+ }
56
+ interface DiffNode {
57
+ nodeId: string;
58
+ name: string;
59
+ type: string;
60
+ score: number;
61
+ filePath: string;
62
+ }
63
+ interface ScoreChange {
64
+ nodeId: string;
65
+ name: string;
66
+ type: string;
67
+ scoreBefore: number;
68
+ scoreAfter: number;
69
+ delta: number;
70
+ }
71
+ interface EdgeChange {
72
+ nodeId: string;
73
+ name: string;
74
+ addedEdges: {
75
+ to: string;
76
+ type: string;
77
+ }[];
78
+ removedEdges: {
79
+ to: string;
80
+ type: string;
81
+ }[];
82
+ }
83
+ interface MovedNode {
84
+ nodeId: string;
85
+ name: string;
86
+ fromFile: string;
87
+ toFile: string;
88
+ scoreBefore: number;
89
+ scoreAfter: number;
90
+ }
91
+ export declare function getCheckpointPath(graphId: string, commitHash: string): string;
92
+ export declare function saveGraph(result: PipelineResult, options?: {
93
+ force?: boolean;
94
+ }): void;
95
+ export declare function getGraph(graphId: string, commitHash?: string): PipelineResult | undefined;
96
+ export declare function getNodeCode(graphId: string, commitHash: string, nodeId: string): CodeNode | undefined;
97
+ export declare function listGraphs(): GraphIndexEntry[];
98
+ export declare function getGraphMeta(graphId: string): GraphMeta | undefined;
99
+ export declare function deleteGraph(graphId: string): boolean;
100
+ export declare function deleteCommit(graphId: string, commitHash: string): boolean;
101
+ export declare function diffCommits(graphId: string, fromHash: string, toHash: string): NodeDiff | undefined;
102
+ export declare function markCommitSummarized(graphId: string, commitHash: string): void;
103
+ export declare function isCommitSummarized(graphId: string, commitHash: string): boolean;
104
+ export declare function findLastSummarizedAncestor(graphId: string, commitHash: string, repoPath: string): Promise<string | undefined>;
105
+ export declare function saveNodeSummaries(graphId: string, commitHash: string, nodeUpdates: Map<string, {
106
+ technicalSummary: string;
107
+ businessSummary: string;
108
+ security: {
109
+ severity: "none" | "low" | "medium" | "high";
110
+ summary: string;
111
+ };
112
+ summaryModel: string;
113
+ summarizedAt: string;
114
+ }>): void;
115
+ export declare function removeFromSummarizedCommits(graphId: string, commitHash: string): void;
116
+ export declare const fileStorage: GraphStorage;
117
+ export {};