code-kg 0.1.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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -0
  3. package/dist/cli/index.d.ts +14 -0
  4. package/dist/cli/index.js +68 -0
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/codekg-config.d.ts +14 -0
  7. package/dist/codekg-config.js +81 -0
  8. package/dist/codekg-config.js.map +1 -0
  9. package/dist/commands/graph.d.ts +7 -0
  10. package/dist/commands/graph.js +49 -0
  11. package/dist/commands/graph.js.map +1 -0
  12. package/dist/commands/init.d.ts +6 -0
  13. package/dist/commands/init.js +13 -0
  14. package/dist/commands/init.js.map +1 -0
  15. package/dist/commands/insights.d.ts +7 -0
  16. package/dist/commands/insights.js +31 -0
  17. package/dist/commands/insights.js.map +1 -0
  18. package/dist/commands/path.d.ts +7 -0
  19. package/dist/commands/path.js +47 -0
  20. package/dist/commands/path.js.map +1 -0
  21. package/dist/commands/reindex.d.ts +6 -0
  22. package/dist/commands/reindex.js +13 -0
  23. package/dist/commands/reindex.js.map +1 -0
  24. package/dist/commands/run.d.ts +6 -0
  25. package/dist/commands/run.js +20 -0
  26. package/dist/commands/run.js.map +1 -0
  27. package/dist/commands/serve.d.ts +8 -0
  28. package/dist/commands/serve.js +25 -0
  29. package/dist/commands/serve.js.map +1 -0
  30. package/dist/config/defaults.d.ts +6 -0
  31. package/dist/config/defaults.js +30 -0
  32. package/dist/config/defaults.js.map +1 -0
  33. package/dist/index.d.ts +52 -0
  34. package/dist/index.js +602 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/indexer/babel-fallback.d.ts +7 -0
  37. package/dist/indexer/babel-fallback.js +583 -0
  38. package/dist/indexer/babel-fallback.js.map +1 -0
  39. package/dist/indexer/file-discovery.d.ts +6 -0
  40. package/dist/indexer/file-discovery.js +106 -0
  41. package/dist/indexer/file-discovery.js.map +1 -0
  42. package/dist/indexer/indexer.d.ts +90 -0
  43. package/dist/indexer/indexer.js +620 -0
  44. package/dist/indexer/indexer.js.map +1 -0
  45. package/dist/indexer/metrics.d.ts +39 -0
  46. package/dist/indexer/metrics.js +147 -0
  47. package/dist/indexer/metrics.js.map +1 -0
  48. package/dist/indexer/structure-detector.d.ts +16 -0
  49. package/dist/indexer/structure-detector.js +159 -0
  50. package/dist/indexer/structure-detector.js.map +1 -0
  51. package/dist/indexer/ts-parser.d.ts +86 -0
  52. package/dist/indexer/ts-parser.js +437 -0
  53. package/dist/indexer/ts-parser.js.map +1 -0
  54. package/dist/model/edge.d.ts +21 -0
  55. package/dist/model/edge.js +25 -0
  56. package/dist/model/edge.js.map +1 -0
  57. package/dist/model/graph.d.ts +10 -0
  58. package/dist/model/graph.js +20 -0
  59. package/dist/model/graph.js.map +1 -0
  60. package/dist/model/node.d.ts +24 -0
  61. package/dist/model/node.js +22 -0
  62. package/dist/model/node.js.map +1 -0
  63. package/dist/query/query-dsl.d.ts +17 -0
  64. package/dist/query/query-dsl.js +75 -0
  65. package/dist/query/query-dsl.js.map +1 -0
  66. package/dist/query/query-engine.d.ts +32 -0
  67. package/dist/query/query-engine.js +126 -0
  68. package/dist/query/query-engine.js.map +1 -0
  69. package/dist/server/api.d.ts +19 -0
  70. package/dist/server/api.js +29 -0
  71. package/dist/server/api.js.map +1 -0
  72. package/dist/server/app.d.ts +7 -0
  73. package/dist/server/app.js +509 -0
  74. package/dist/server/app.js.map +1 -0
  75. package/dist/server/graph-controller.d.ts +147 -0
  76. package/dist/server/graph-controller.js +186 -0
  77. package/dist/server/graph-controller.js.map +1 -0
  78. package/dist/server/routes.d.ts +3 -0
  79. package/dist/server/routes.js +19 -0
  80. package/dist/server/routes.js.map +1 -0
  81. package/dist/server/ui.d.ts +1 -0
  82. package/dist/server/ui.js +1165 -0
  83. package/dist/server/ui.js.map +1 -0
  84. package/dist/store/sqlite-store.d.ts +83 -0
  85. package/dist/store/sqlite-store.js +647 -0
  86. package/dist/store/sqlite-store.js.map +1 -0
  87. package/dist/utils/ids.d.ts +2 -0
  88. package/dist/utils/ids.js +9 -0
  89. package/dist/utils/ids.js.map +1 -0
  90. package/dist/utils/path.d.ts +3 -0
  91. package/dist/utils/path.js +21 -0
  92. package/dist/utils/path.js.map +1 -0
  93. package/package.json +58 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/server/ui.ts"],"names":[],"mappings":";;AAAA,oCAwoCC;AAxoCD,SAAgB,YAAY;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsoCD,CAAC;AACT,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { type GraphQuery } from "../query/query-dsl";
2
+ import { type QueryDataSource, type QueryEdge, type QueryGraph, type QueryNode, type QueryResult } from "../query/query-engine";
3
+ export interface GraphSnapshot {
4
+ nodes: QueryNode[];
5
+ edges: QueryEdge[];
6
+ }
7
+ export interface CyclesInfo {
8
+ cycles: Array<{
9
+ nodes: QueryNode[];
10
+ edges: QueryEdge[];
11
+ }>;
12
+ totalCycles: number;
13
+ }
14
+ export interface GraphFilterOptions {
15
+ view?: string;
16
+ nodeTypes?: string[];
17
+ edgeTypes?: string[];
18
+ q?: string;
19
+ limit?: number;
20
+ }
21
+ export type SubgraphDirection = "in" | "out" | "both";
22
+ export interface PathQueryResult {
23
+ from: string;
24
+ to: string;
25
+ maxDepth: number;
26
+ found: boolean;
27
+ length: number;
28
+ nodeIds: string[];
29
+ edgeIds: string[];
30
+ nodes: QueryNode[];
31
+ edges: QueryEdge[];
32
+ }
33
+ export interface RefactorInsightsHotspot {
34
+ nodeId: string;
35
+ path: string | null;
36
+ fanIn: number;
37
+ fanOut: number;
38
+ score: number;
39
+ }
40
+ export interface RefactorInsightsUnusedExport {
41
+ symbolId: string;
42
+ name: string | null;
43
+ fileId: string;
44
+ filePath: string | null;
45
+ }
46
+ export interface RefactorInsights {
47
+ hotspots: RefactorInsightsHotspot[];
48
+ orphanModules: Array<{
49
+ nodeId: string;
50
+ path: string | null;
51
+ }>;
52
+ unusedExports: RefactorInsightsUnusedExport[];
53
+ cycleCount: number;
54
+ }
55
+ export declare class SqliteStore implements QueryDataSource {
56
+ private readonly db;
57
+ constructor(dbPath: string);
58
+ close(): void;
59
+ initializeSchema(): void;
60
+ initSchema(): void;
61
+ replaceGraph(snapshot: GraphSnapshot): void;
62
+ replaceGraphAtomically(snapshot: GraphSnapshot): void;
63
+ searchNodes(queryText: string, limit?: number): QueryNode[];
64
+ getNodeById(nodeId: string): QueryNode | null;
65
+ findNodesByName(symbol: string): QueryNode[];
66
+ getOutgoingEdges(nodeId: string): QueryEdge[];
67
+ getIncomingEdges(nodeId: string): QueryEdge[];
68
+ getAllGraph(): QueryGraph;
69
+ private getSymbolGraph;
70
+ getFileDependencyGraph(): QueryGraph;
71
+ getGraph(options?: GraphFilterOptions): QueryGraph;
72
+ getSubgraph(seedNodeId: string, depth?: number, direction?: SubgraphDirection): QueryGraph;
73
+ findShortestPath(fromNodeId: string, toNodeId: string, maxDepth?: number, edgeTypes?: string[]): PathQueryResult;
74
+ getRoutesList(): QueryNode[];
75
+ getRoutes(): QueryNode[];
76
+ getCyclesInfo(): CyclesInfo;
77
+ getCycles(): CyclesInfo;
78
+ getRefactorInsights(limit?: number): RefactorInsights;
79
+ runDeterministicQuery(queryInput: GraphQuery | unknown): QueryResult;
80
+ runQuery(queryInput: GraphQuery | unknown): QueryResult;
81
+ private mapNodeRow;
82
+ private mapEdgeRow;
83
+ }