@bugsbunnycodes1998/cartographer-core 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 (220) hide show
  1. package/dist/__tests__/pipeline.test.d.ts +2 -0
  2. package/dist/__tests__/pipeline.test.d.ts.map +1 -0
  3. package/dist/__tests__/pipeline.test.js +58 -0
  4. package/dist/__tests__/pipeline.test.js.map +1 -0
  5. package/dist/analysis/call-graph.d.ts +13 -0
  6. package/dist/analysis/call-graph.d.ts.map +1 -0
  7. package/dist/analysis/call-graph.js +133 -0
  8. package/dist/analysis/call-graph.js.map +1 -0
  9. package/dist/analysis/dependency-graph.d.ts +8 -0
  10. package/dist/analysis/dependency-graph.d.ts.map +1 -0
  11. package/dist/analysis/dependency-graph.js +101 -0
  12. package/dist/analysis/dependency-graph.js.map +1 -0
  13. package/dist/analysis/git/archaeology.d.ts +20 -0
  14. package/dist/analysis/git/archaeology.d.ts.map +1 -0
  15. package/dist/analysis/git/archaeology.js +61 -0
  16. package/dist/analysis/git/archaeology.js.map +1 -0
  17. package/dist/analysis/git/bus-factor.d.ts +17 -0
  18. package/dist/analysis/git/bus-factor.d.ts.map +1 -0
  19. package/dist/analysis/git/bus-factor.js +90 -0
  20. package/dist/analysis/git/bus-factor.js.map +1 -0
  21. package/dist/analysis/git/churn.d.ts +26 -0
  22. package/dist/analysis/git/churn.d.ts.map +1 -0
  23. package/dist/analysis/git/churn.js +127 -0
  24. package/dist/analysis/git/churn.js.map +1 -0
  25. package/dist/analysis/git/contributors.d.ts +14 -0
  26. package/dist/analysis/git/contributors.d.ts.map +1 -0
  27. package/dist/analysis/git/contributors.js +60 -0
  28. package/dist/analysis/git/contributors.js.map +1 -0
  29. package/dist/analysis/git/evolution.d.ts +10 -0
  30. package/dist/analysis/git/evolution.d.ts.map +1 -0
  31. package/dist/analysis/git/evolution.js +127 -0
  32. package/dist/analysis/git/evolution.js.map +1 -0
  33. package/dist/analysis/git/index.d.ts +6 -0
  34. package/dist/analysis/git/index.d.ts.map +1 -0
  35. package/dist/analysis/git/index.js +6 -0
  36. package/dist/analysis/git/index.js.map +1 -0
  37. package/dist/analysis/go-visitor.d.ts +4 -0
  38. package/dist/analysis/go-visitor.d.ts.map +1 -0
  39. package/dist/analysis/go-visitor.js +295 -0
  40. package/dist/analysis/go-visitor.js.map +1 -0
  41. package/dist/analysis/health/indicators.d.ts +25 -0
  42. package/dist/analysis/health/indicators.d.ts.map +1 -0
  43. package/dist/analysis/health/indicators.js +53 -0
  44. package/dist/analysis/health/indicators.js.map +1 -0
  45. package/dist/analysis/health/scorer.d.ts +26 -0
  46. package/dist/analysis/health/scorer.d.ts.map +1 -0
  47. package/dist/analysis/health/scorer.js +97 -0
  48. package/dist/analysis/health/scorer.js.map +1 -0
  49. package/dist/analysis/health/test-coverage.d.ts +19 -0
  50. package/dist/analysis/health/test-coverage.d.ts.map +1 -0
  51. package/dist/analysis/health/test-coverage.js +67 -0
  52. package/dist/analysis/health/test-coverage.js.map +1 -0
  53. package/dist/analysis/import-resolver.d.ts +10 -0
  54. package/dist/analysis/import-resolver.d.ts.map +1 -0
  55. package/dist/analysis/import-resolver.js +353 -0
  56. package/dist/analysis/import-resolver.js.map +1 -0
  57. package/dist/analysis/index.d.ts +22 -0
  58. package/dist/analysis/index.d.ts.map +1 -0
  59. package/dist/analysis/index.js +24 -0
  60. package/dist/analysis/index.js.map +1 -0
  61. package/dist/analysis/java-visitor.d.ts +4 -0
  62. package/dist/analysis/java-visitor.d.ts.map +1 -0
  63. package/dist/analysis/java-visitor.js +257 -0
  64. package/dist/analysis/java-visitor.js.map +1 -0
  65. package/dist/analysis/metrics.d.ts +19 -0
  66. package/dist/analysis/metrics.d.ts.map +1 -0
  67. package/dist/analysis/metrics.js +70 -0
  68. package/dist/analysis/metrics.js.map +1 -0
  69. package/dist/analysis/module-detector.d.ts +3 -0
  70. package/dist/analysis/module-detector.d.ts.map +1 -0
  71. package/dist/analysis/module-detector.js +257 -0
  72. package/dist/analysis/module-detector.js.map +1 -0
  73. package/dist/analysis/parser.d.ts +13 -0
  74. package/dist/analysis/parser.d.ts.map +1 -0
  75. package/dist/analysis/parser.js +92 -0
  76. package/dist/analysis/parser.js.map +1 -0
  77. package/dist/analysis/python-visitor.d.ts +4 -0
  78. package/dist/analysis/python-visitor.d.ts.map +1 -0
  79. package/dist/analysis/python-visitor.js +306 -0
  80. package/dist/analysis/python-visitor.js.map +1 -0
  81. package/dist/analysis/rust-visitor.d.ts +4 -0
  82. package/dist/analysis/rust-visitor.d.ts.map +1 -0
  83. package/dist/analysis/rust-visitor.js +318 -0
  84. package/dist/analysis/rust-visitor.js.map +1 -0
  85. package/dist/analysis/semantic/cache.d.ts +16 -0
  86. package/dist/analysis/semantic/cache.d.ts.map +1 -0
  87. package/dist/analysis/semantic/cache.js +26 -0
  88. package/dist/analysis/semantic/cache.js.map +1 -0
  89. package/dist/analysis/semantic/openai-client.d.ts +21 -0
  90. package/dist/analysis/semantic/openai-client.d.ts.map +1 -0
  91. package/dist/analysis/semantic/openai-client.js +73 -0
  92. package/dist/analysis/semantic/openai-client.js.map +1 -0
  93. package/dist/analysis/semantic/prompts.d.ts +32 -0
  94. package/dist/analysis/semantic/prompts.d.ts.map +1 -0
  95. package/dist/analysis/semantic/prompts.js +134 -0
  96. package/dist/analysis/semantic/prompts.js.map +1 -0
  97. package/dist/analysis/semantic/summarizer.d.ts +36 -0
  98. package/dist/analysis/semantic/summarizer.d.ts.map +1 -0
  99. package/dist/analysis/semantic/summarizer.js +229 -0
  100. package/dist/analysis/semantic/summarizer.js.map +1 -0
  101. package/dist/analysis/ts-js-visitor.d.ts +4 -0
  102. package/dist/analysis/ts-js-visitor.d.ts.map +1 -0
  103. package/dist/analysis/ts-js-visitor.js +390 -0
  104. package/dist/analysis/ts-js-visitor.js.map +1 -0
  105. package/dist/analysis/visitor-registry.d.ts +5 -0
  106. package/dist/analysis/visitor-registry.d.ts.map +1 -0
  107. package/dist/analysis/visitor-registry.js +17 -0
  108. package/dist/analysis/visitor-registry.js.map +1 -0
  109. package/dist/analysis/visitor-utils.d.ts +38 -0
  110. package/dist/analysis/visitor-utils.d.ts.map +1 -0
  111. package/dist/analysis/visitor-utils.js +110 -0
  112. package/dist/analysis/visitor-utils.js.map +1 -0
  113. package/dist/errors.d.ts +20 -0
  114. package/dist/errors.d.ts.map +1 -0
  115. package/dist/errors.js +39 -0
  116. package/dist/errors.js.map +1 -0
  117. package/dist/expeditions/custom.d.ts +11 -0
  118. package/dist/expeditions/custom.d.ts.map +1 -0
  119. package/dist/expeditions/custom.js +61 -0
  120. package/dist/expeditions/custom.js.map +1 -0
  121. package/dist/expeditions/danger-zones.d.ts +9 -0
  122. package/dist/expeditions/danger-zones.d.ts.map +1 -0
  123. package/dist/expeditions/danger-zones.js +42 -0
  124. package/dist/expeditions/danger-zones.js.map +1 -0
  125. package/dist/expeditions/generator.d.ts +21 -0
  126. package/dist/expeditions/generator.d.ts.map +1 -0
  127. package/dist/expeditions/generator.js +78 -0
  128. package/dist/expeditions/generator.js.map +1 -0
  129. package/dist/expeditions/grand-tour.d.ts +10 -0
  130. package/dist/expeditions/grand-tour.d.ts.map +1 -0
  131. package/dist/expeditions/grand-tour.js +96 -0
  132. package/dist/expeditions/grand-tour.js.map +1 -0
  133. package/dist/expeditions/request-flow.d.ts +11 -0
  134. package/dist/expeditions/request-flow.d.ts.map +1 -0
  135. package/dist/expeditions/request-flow.js +138 -0
  136. package/dist/expeditions/request-flow.js.map +1 -0
  137. package/dist/grammars/tree-sitter-go.wasm +0 -0
  138. package/dist/grammars/tree-sitter-java.wasm +0 -0
  139. package/dist/grammars/tree-sitter-javascript.wasm +0 -0
  140. package/dist/grammars/tree-sitter-python.wasm +0 -0
  141. package/dist/grammars/tree-sitter-rust.wasm +0 -0
  142. package/dist/grammars/tree-sitter-tsx.wasm +0 -0
  143. package/dist/grammars/tree-sitter-typescript.wasm +0 -0
  144. package/dist/graph/builder.d.ts +23 -0
  145. package/dist/graph/builder.d.ts.map +1 -0
  146. package/dist/graph/builder.js +131 -0
  147. package/dist/graph/builder.js.map +1 -0
  148. package/dist/graph/exporter.d.ts +5 -0
  149. package/dist/graph/exporter.d.ts.map +1 -0
  150. package/dist/graph/exporter.js +20 -0
  151. package/dist/graph/exporter.js.map +1 -0
  152. package/dist/graph/layout.d.ts +3 -0
  153. package/dist/graph/layout.d.ts.map +1 -0
  154. package/dist/graph/layout.js +257 -0
  155. package/dist/graph/layout.js.map +1 -0
  156. package/dist/graph/store.d.ts +13 -0
  157. package/dist/graph/store.d.ts.map +1 -0
  158. package/dist/graph/store.js +145 -0
  159. package/dist/graph/store.js.map +1 -0
  160. package/dist/index.d.ts +17 -0
  161. package/dist/index.d.ts.map +1 -0
  162. package/dist/index.js +12 -0
  163. package/dist/index.js.map +1 -0
  164. package/dist/ingestion/cloner.d.ts +18 -0
  165. package/dist/ingestion/cloner.d.ts.map +1 -0
  166. package/dist/ingestion/cloner.js +62 -0
  167. package/dist/ingestion/cloner.js.map +1 -0
  168. package/dist/ingestion/file-tree.d.ts +3 -0
  169. package/dist/ingestion/file-tree.d.ts.map +1 -0
  170. package/dist/ingestion/file-tree.js +85 -0
  171. package/dist/ingestion/file-tree.js.map +1 -0
  172. package/dist/ingestion/index.d.ts +5 -0
  173. package/dist/ingestion/index.d.ts.map +1 -0
  174. package/dist/ingestion/index.js +5 -0
  175. package/dist/ingestion/index.js.map +1 -0
  176. package/dist/ingestion/language-detector.d.ts +8 -0
  177. package/dist/ingestion/language-detector.d.ts.map +1 -0
  178. package/dist/ingestion/language-detector.js +37 -0
  179. package/dist/ingestion/language-detector.js.map +1 -0
  180. package/dist/ingestion/path-resolver.d.ts +7 -0
  181. package/dist/ingestion/path-resolver.d.ts.map +1 -0
  182. package/dist/ingestion/path-resolver.js +30 -0
  183. package/dist/ingestion/path-resolver.js.map +1 -0
  184. package/dist/logger.d.ts +3 -0
  185. package/dist/logger.d.ts.map +1 -0
  186. package/dist/logger.js +11 -0
  187. package/dist/logger.js.map +1 -0
  188. package/dist/pipeline.d.ts +3 -0
  189. package/dist/pipeline.d.ts.map +1 -0
  190. package/dist/pipeline.js +223 -0
  191. package/dist/pipeline.js.map +1 -0
  192. package/dist/types/analysis.d.ts +51 -0
  193. package/dist/types/analysis.d.ts.map +1 -0
  194. package/dist/types/analysis.js +2 -0
  195. package/dist/types/analysis.js.map +1 -0
  196. package/dist/types/config.d.ts +19 -0
  197. package/dist/types/config.d.ts.map +1 -0
  198. package/dist/types/config.js +2 -0
  199. package/dist/types/config.js.map +1 -0
  200. package/dist/types/edges.d.ts +8 -0
  201. package/dist/types/edges.d.ts.map +1 -0
  202. package/dist/types/edges.js +2 -0
  203. package/dist/types/edges.js.map +1 -0
  204. package/dist/types/expeditions.d.ts +19 -0
  205. package/dist/types/expeditions.d.ts.map +1 -0
  206. package/dist/types/expeditions.js +2 -0
  207. package/dist/types/expeditions.js.map +1 -0
  208. package/dist/types/graph.d.ts +29 -0
  209. package/dist/types/graph.d.ts.map +1 -0
  210. package/dist/types/graph.js +2 -0
  211. package/dist/types/graph.js.map +1 -0
  212. package/dist/types/index.d.ts +7 -0
  213. package/dist/types/index.d.ts.map +1 -0
  214. package/dist/types/index.js +2 -0
  215. package/dist/types/index.js.map +1 -0
  216. package/dist/types/nodes.d.ts +35 -0
  217. package/dist/types/nodes.d.ts.map +1 -0
  218. package/dist/types/nodes.js +2 -0
  219. package/dist/types/nodes.js.map +1 -0
  220. package/package.json +36 -0
@@ -0,0 +1,17 @@
1
+ export { analyze } from "./pipeline.js";
2
+ export { exportGraph, writeGraphJSON } from "./graph/exporter.js";
3
+ export { createDatabase } from "./graph/store.js";
4
+ export { setLogLevel } from "./logger.js";
5
+ export { isGitUrl, cloneRepo } from "./ingestion/cloner.js";
6
+ export { analyzeGitHistory } from "./analysis/git/index.js";
7
+ export { buildCallGraph } from "./analysis/call-graph.js";
8
+ export { generateExpeditions } from "./expeditions/generator.js";
9
+ export { generateCustomExpedition } from "./expeditions/custom.js";
10
+ export { OpenAIClient } from "./analysis/semantic/openai-client.js";
11
+ export type { LlmOptions } from "./analysis/semantic/openai-client.js";
12
+ export type { CloneOptions, } from "./ingestion/cloner.js";
13
+ export type { GitArchaeologyResult, ChurnData, BusFactorData, ContributorInfo, } from "./analysis/git/index.js";
14
+ export type { CallGraphResult, } from "./analysis/call-graph.js";
15
+ export type { GenerateExpeditionsOptions, } from "./expeditions/generator.js";
16
+ export type { NodeKind, ArchitecturalLayer, Position3D, Dimensions3D, GraphNode, EdgeKind, GraphEdge, GraphMeta, EvolutionSnapshot, CartographerGraph, ProgressEvent, AnalyzeOptions, SupportedLanguage, FileEntry, ImportStatement, ExportStatement, FunctionDeclaration, FunctionCallSite, FileAnalysis, ModuleInfo, ExpeditionKind, ExpeditionStep, Expedition, } from "./types/index.js";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,YAAY,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAGvE,YAAY,EACV,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ // @cartographer/core — public API
2
+ export { analyze } from "./pipeline.js";
3
+ export { exportGraph, writeGraphJSON } from "./graph/exporter.js";
4
+ export { createDatabase } from "./graph/store.js";
5
+ export { setLogLevel } from "./logger.js";
6
+ export { isGitUrl, cloneRepo } from "./ingestion/cloner.js";
7
+ export { analyzeGitHistory } from "./analysis/git/index.js";
8
+ export { buildCallGraph } from "./analysis/call-graph.js";
9
+ export { generateExpeditions } from "./expeditions/generator.js";
10
+ export { generateCustomExpedition } from "./expeditions/custom.js";
11
+ export { OpenAIClient } from "./analysis/semantic/openai-client.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Detect whether the input string is a Git URL
3
+ * (GitHub/GitLab/Bitbucket HTTPS, or git@ SSH patterns).
4
+ */
5
+ export declare function isGitUrl(input: string): boolean;
6
+ export interface CloneOptions {
7
+ branch?: string;
8
+ depth?: number;
9
+ }
10
+ /**
11
+ * Clone a git repository into a temporary directory using isomorphic-git.
12
+ * Returns the local path to the cloned repository.
13
+ *
14
+ * Defaults to a shallow clone (depth: 1) for speed.
15
+ * Use a higher depth or omit depth for full history (needed for git archaeology).
16
+ */
17
+ export declare function cloneRepo(url: string, options?: CloneOptions): Promise<string>;
18
+ //# sourceMappingURL=cloner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloner.d.ts","sourceRoot":"","sources":["../../src/ingestion/cloner.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAW/C;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,MAAM,CAAC,CAyCjB"}
@@ -0,0 +1,62 @@
1
+ import fs from "node:fs";
2
+ import { join } from "node:path";
3
+ import { tmpdir } from "node:os";
4
+ import { randomBytes } from "node:crypto";
5
+ import git from "isomorphic-git";
6
+ import http from "isomorphic-git/http/node";
7
+ import { GitError } from "../errors.js";
8
+ import { logger } from "../logger.js";
9
+ /**
10
+ * Detect whether the input string is a Git URL
11
+ * (GitHub/GitLab/Bitbucket HTTPS, or git@ SSH patterns).
12
+ */
13
+ export function isGitUrl(input) {
14
+ // HTTPS patterns: https://github.com/org/repo, https://gitlab.com/org/repo, etc.
15
+ const httpsPattern = /^https?:\/\/(github\.com|gitlab\.com|bitbucket\.org|[\w.-]+)\/.+/;
16
+ // SSH patterns: git@github.com:org/repo.git
17
+ const sshPattern = /^git@[\w.-]+:.+/;
18
+ // Generic git:// protocol
19
+ const gitProtocolPattern = /^git:\/\/.+/;
20
+ return httpsPattern.test(input) || sshPattern.test(input) || gitProtocolPattern.test(input);
21
+ }
22
+ /**
23
+ * Clone a git repository into a temporary directory using isomorphic-git.
24
+ * Returns the local path to the cloned repository.
25
+ *
26
+ * Defaults to a shallow clone (depth: 1) for speed.
27
+ * Use a higher depth or omit depth for full history (needed for git archaeology).
28
+ */
29
+ export async function cloneRepo(url, options) {
30
+ const depth = options?.depth ?? 1;
31
+ const suffix = randomBytes(8).toString("hex");
32
+ const dir = join(tmpdir(), `cartographer-clone-${suffix}`);
33
+ try {
34
+ fs.mkdirSync(dir, { recursive: true });
35
+ logger.info(`Cloning ${url} into ${dir} (depth: ${depth})...`);
36
+ const cloneOpts = {
37
+ fs,
38
+ http,
39
+ dir,
40
+ url,
41
+ depth,
42
+ singleBranch: true,
43
+ };
44
+ if (options?.branch) {
45
+ cloneOpts.ref = options.branch;
46
+ }
47
+ await git.clone(cloneOpts);
48
+ logger.info(`Clone complete: ${dir}`);
49
+ return dir;
50
+ }
51
+ catch (err) {
52
+ // Clean up the temp directory on failure
53
+ try {
54
+ fs.rmSync(dir, { recursive: true, force: true });
55
+ }
56
+ catch {
57
+ // Ignore cleanup errors
58
+ }
59
+ throw new GitError(`Failed to clone repository: ${url} — ${err instanceof Error ? err.message : String(err)}`, "GIT_CLONE_ERROR", { cause: err instanceof Error ? err : undefined });
60
+ }
61
+ }
62
+ //# sourceMappingURL=cloner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloner.js","sourceRoot":"","sources":["../../src/ingestion/cloner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,iFAAiF;IACjF,MAAM,YAAY,GAAG,kEAAkE,CAAC;IAExF,4CAA4C;IAC5C,MAAM,UAAU,GAAG,iBAAiB,CAAC;IAErC,0BAA0B;IAC1B,MAAM,kBAAkB,GAAG,aAAa,CAAC;IAEzC,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9F,CAAC;AAOD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,OAAsB;IAEtB,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,sBAAsB,MAAM,EAAE,CAAC,CAAC;IAE3D,IAAI,CAAC;QACH,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEvC,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,SAAS,GAAG,YAAY,KAAK,MAAM,CAAC,CAAC;QAE/D,MAAM,SAAS,GAAoC;YACjD,EAAE;YACF,IAAI;YACJ,GAAG;YACH,GAAG;YACH,KAAK;YACL,YAAY,EAAE,IAAI;SACnB,CAAC;QAEF,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QACjC,CAAC;QAED,MAAM,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAE3B,MAAM,CAAC,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAC;QACtC,OAAO,GAAG,CAAC;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,yCAAyC;QACzC,IAAI,CAAC;YACH,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;QAED,MAAM,IAAI,QAAQ,CAChB,+BAA+B,GAAG,MAAM,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAC1F,iBAAiB,EACjB,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAClD,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FileEntry } from "../types/index.js";
2
+ export declare function buildFileTree(rootDir: string, scopeDir: string): FileEntry[];
3
+ //# sourceMappingURL=file-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-tree.d.ts","sourceRoot":"","sources":["../../src/ingestion/file-tree.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAiCnD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,CAsD5E"}
@@ -0,0 +1,85 @@
1
+ import { readdirSync, readFileSync, statSync } from "node:fs";
2
+ import { join, relative } from "node:path";
3
+ import ignore, {} from "ignore";
4
+ import { logger } from "../logger.js";
5
+ const ALWAYS_IGNORE = [
6
+ "node_modules",
7
+ ".git",
8
+ "dist",
9
+ "build",
10
+ ".cartographer",
11
+ "coverage",
12
+ ".next",
13
+ ".nuxt",
14
+ "__pycache__",
15
+ ".tox",
16
+ "target",
17
+ ".DS_Store",
18
+ "Thumbs.db",
19
+ ];
20
+ function normalizePath(p) {
21
+ return p.replace(/\\/g, "/");
22
+ }
23
+ function loadGitignore(dirPath) {
24
+ try {
25
+ const gitignorePath = join(dirPath, ".gitignore");
26
+ const content = readFileSync(gitignorePath, "utf-8");
27
+ return ignore().add(content);
28
+ }
29
+ catch {
30
+ return null;
31
+ }
32
+ }
33
+ export function buildFileTree(rootDir, scopeDir) {
34
+ const files = [];
35
+ const rootIgnore = ignore().add(ALWAYS_IGNORE);
36
+ const gitignoreAtRoot = loadGitignore(rootDir);
37
+ if (gitignoreAtRoot) {
38
+ rootIgnore.add(gitignoreAtRoot);
39
+ }
40
+ function walk(dir, ig) {
41
+ let entries;
42
+ try {
43
+ entries = readdirSync(dir, { withFileTypes: true });
44
+ }
45
+ catch (err) {
46
+ logger.debug(`Skipping unreadable directory: ${dir}`);
47
+ return;
48
+ }
49
+ // Check for nested .gitignore
50
+ const nestedGitignore = loadGitignore(dir);
51
+ const currentIgnore = nestedGitignore ? ignore().add(ig).add(nestedGitignore) : ig;
52
+ for (const entry of entries) {
53
+ const fullPath = join(dir, entry.name);
54
+ const relPath = normalizePath(relative(rootDir, fullPath));
55
+ if (currentIgnore.ignores(relPath)) {
56
+ continue;
57
+ }
58
+ if (entry.isDirectory()) {
59
+ // Also check with trailing slash for directory patterns
60
+ if (currentIgnore.ignores(relPath + "/")) {
61
+ continue;
62
+ }
63
+ walk(fullPath, currentIgnore);
64
+ }
65
+ else if (entry.isFile()) {
66
+ try {
67
+ const stat = statSync(fullPath);
68
+ files.push({
69
+ relativePath: relPath,
70
+ absolutePath: normalizePath(fullPath),
71
+ language: null, // Set by language detector
72
+ sizeBytes: stat.size,
73
+ });
74
+ }
75
+ catch {
76
+ logger.debug(`Skipping unreadable file: ${fullPath}`);
77
+ }
78
+ }
79
+ }
80
+ }
81
+ walk(scopeDir, rootIgnore);
82
+ files.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
83
+ return files;
84
+ }
85
+ //# sourceMappingURL=file-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-tree.js","sourceRoot":"","sources":["../../src/ingestion/file-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,MAAM,EAAE,EAAe,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,aAAa,GAAG;IACpB,cAAc;IACd,MAAM;IACN,MAAM;IACN,OAAO;IACP,eAAe;IACf,UAAU;IACV,OAAO;IACP,OAAO;IACP,aAAa;IACb,MAAM;IACN,QAAQ;IACR,WAAW;IACX,WAAW;CACZ,CAAC;AAEF,SAAS,aAAa,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,aAAa,CAAC,OAAe;IACpC,IAAI,CAAC;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O,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;YAE3D,IAAI,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnC,SAAS;YACX,CAAC;YAED,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,wDAAwD;gBACxD,IAAI,aAAa,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC;oBACzC,SAAS;gBACX,CAAC;gBACD,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YAChC,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC1B,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;oBAChC,KAAK,CAAC,IAAI,CAAC;wBACT,YAAY,EAAE,OAAO;wBACrB,YAAY,EAAE,aAAa,CAAC,QAAQ,CAAC;wBACrC,QAAQ,EAAE,IAAI,EAAE,2BAA2B;wBAC3C,SAAS,EAAE,IAAI,CAAC,IAAI;qBACrB,CAAC,CAAC;gBACL,CAAC;gBAAC,MAAM,CAAC;oBACP,MAAM,CAAC,KAAK,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAC;gBACxD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { resolvePaths, type IngestionContext } from "./path-resolver.js";
2
+ export { buildFileTree } from "./file-tree.js";
3
+ export { detectLanguages, filterToSupported, type LanguageDetectionResult } from "./language-detector.js";
4
+ export { isGitUrl, cloneRepo, type CloneOptions } from "./cloner.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ingestion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { resolvePaths } from "./path-resolver.js";
2
+ export { buildFileTree } from "./file-tree.js";
3
+ export { detectLanguages, filterToSupported } from "./language-detector.js";
4
+ export { isGitUrl, cloneRepo } from "./cloner.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ingestion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAgC,MAAM,wBAAwB,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { FileEntry, SupportedLanguage } from "../types/index.js";
2
+ export interface LanguageDetectionResult {
3
+ files: FileEntry[];
4
+ languages: SupportedLanguage[];
5
+ }
6
+ export declare function detectLanguages(files: FileEntry[]): LanguageDetectionResult;
7
+ export declare function filterToSupported(files: FileEntry[]): FileEntry[];
8
+ //# sourceMappingURL=language-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-detector.d.ts","sourceRoot":"","sources":["../../src/ingestion/language-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAqBtE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,uBAAuB,CAgB3E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAEjE"}
@@ -0,0 +1,37 @@
1
+ const EXTENSION_MAP = {
2
+ ".ts": "typescript",
3
+ ".tsx": "typescript",
4
+ ".js": "javascript",
5
+ ".jsx": "javascript",
6
+ ".mjs": "javascript",
7
+ ".cjs": "javascript",
8
+ ".py": "python",
9
+ ".rs": "rust",
10
+ ".go": "go",
11
+ ".java": "java",
12
+ };
13
+ function getExtension(filePath) {
14
+ const lastDot = filePath.lastIndexOf(".");
15
+ if (lastDot === -1)
16
+ return "";
17
+ return filePath.slice(lastDot);
18
+ }
19
+ export function detectLanguages(files) {
20
+ const languageSet = new Set();
21
+ const annotatedFiles = files.map((file) => {
22
+ const ext = getExtension(file.relativePath);
23
+ const language = EXTENSION_MAP[ext] ?? null;
24
+ if (language) {
25
+ languageSet.add(language);
26
+ }
27
+ return { ...file, language };
28
+ });
29
+ return {
30
+ files: annotatedFiles,
31
+ languages: [...languageSet].sort(),
32
+ };
33
+ }
34
+ export function filterToSupported(files) {
35
+ return files.filter((f) => f.language !== null);
36
+ }
37
+ //# sourceMappingURL=language-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-detector.js","sourceRoot":"","sources":["../../src/ingestion/language-detector.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAsC;IACvD,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,YAAY;IACnB,MAAM,E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6
+ export declare function resolvePaths(rootDir: string, scopeDir?: string, outputDir?: string): IngestionContext;
7
+ //# sourceMappingURL=path-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-resolver.d.ts","sourceRoot":"","sources":["../../src/ingestion/path-resolver.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACjB,gBAAgB,CAsClB"}
@@ -0,0 +1,30 @@
1
+ import { existsSync, statSync } from "node:fs";
2
+ import { resolve, join } from "node:path";
3
+ import { IngestionError } from "../errors.js";
4
+ function normalizePath(p) {
5
+ return p.replace(/\\/g, "/");
6
+ }
7
+ export function resolvePaths(rootDir, scopeDir, outputDir) {
8
+ const absoluteRoot = normalizePath(resolve(rootDir));
9
+ if (!existsSync(absoluteRoot)) {
10
+ throw new IngestionError(`Directory does not exist: ${absoluteRoot}`, "DIR_NOT_FOUND");
11
+ }
12
+ const stat = statSync(absoluteRoot);
13
+ if (!stat.isDirectory()) {
14
+ throw new IngestionError(`Path is not a directory: ${absoluteRoot}`, "NOT_A_DIRECTORY");
15
+ }
16
+ let absoluteScope = absoluteRoot;
17
+ if (scopeDir) {
18
+ absoluteScope = normalizePath(resolve(absoluteRoot, scopeDir));
19
+ if (!existsSync(absoluteScope)) {
20
+ throw new IngestionError(`Scope directory does not exist: ${absoluteScope}`, "SCOPE_NOT_FOUND");
21
+ }
22
+ }
23
+ const absoluteOutput = normalizePath(outputDir ? resolve(outputDir) : join(absoluteRoot, ".cartographer"));
24
+ return {
25
+ rootDir: absoluteRoot,
26
+ scopeDir: absoluteScope,
27
+ outputDir: absoluteOutput,
28
+ };
29
+ }
30
+ //# sourceMappingURL=path-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AAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CACrE,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,YAAY;QACrB,QAAQ,EAAE,aAAa;QACvB,SAAS,EAAE,cAAc;KAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const logger: import("consola").ConsolaInstance;
2
+ export declare function setLogLevel(level: number): void;
3
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,mCAKjB,CAAC;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAE/C"}
package/dist/logger.js ADDED
@@ -0,0 +1,11 @@
1
+ import { createConsola } from "consola";
2
+ export const logger = createConsola({
3
+ level: 3, // info
4
+ formatOptions: {
5
+ date: false,
6
+ },
7
+ });
8
+ export function setLogLevel(level) {
9
+ logger.level = level;
10
+ }
11
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC;IAClC,KAAK,EAAE,CAAC,EAAE,OAAO;IACjB,aAAa,EAAE;QACb,IAAI,EAAE,KAAK;KACZ;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;AACvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { AnalyzeOptions, CartographerGraph } from "./types/index.js";
2
+ export declare function analyze(options: AnalyzeOptions): Promise<CartographerGraph>;
3
+ //# sourceMappingURL=pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAA+B,MAAM,kBAAkB,CAAC;AAwBvG,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAmPjF"}
@@ -0,0 +1,223 @@
1
+ import { existsSync, mkdirSync, readFileSync } from "node:fs";
2
+ import { join, relative } from "node:path";
3
+ import { resolvePaths } from "./ingestion/path-resolver.js";
4
+ import { buildFileTree } from "./ingestion/file-tree.js";
5
+ import { detectLanguages, filterToSupported } from "./ingestion/language-detector.js";
6
+ import { initParser, parseFile } from "./analysis/parser.js";
7
+ import { getVisitor } from "./analysis/visitor-registry.js";
8
+ import { loadTsConfigPaths, resolveAllImports } from "./analysis/import-resolver.js";
9
+ import { detectModules } from "./analysis/module-detector.js";
10
+ import { buildDependencyGraph } from "./analysis/dependency-graph.js";
11
+ import { computeFileMetrics, computeModuleMetrics } from "./analysis/metrics.js";
12
+ import { buildGraph } from "./graph/builder.js";
13
+ import { computeLayout } from "./graph/layout.js";
14
+ import { createDatabase, insertNodes, insertEdges, insertExpeditions } from "./graph/store.js";
15
+ import { exportGraph, writeGraphJSON } from "./graph/exporter.js";
16
+ import { logger } from "./logger.js";
17
+ function normalizePath(p) {
18
+ return p.replace(/\\/g, "/");
19
+ }
20
+ export async function analyze(options) {
21
+ // Quick mode: structure only, no git, no LLM, no call graph
22
+ if (options.quick) {
23
+ options.skipGit = true;
24
+ options.skipLlm = true;
25
+ }
26
+ const emit = (event) => {
27
+ options.onProgress?.(event);
28
+ };
29
+ // 1. Resolve paths
30
+ emit({ stage: "ingestion", message: "Resolving paths..." });
31
+ const context = resolvePaths(options.rootDir, options.scopeDir, options.outputDir);
32
+ mkdirSync(context.outputDir, { recursive: true });
33
+ // 2. Build file tree
34
+ emit({ stage: "ingestion", message: "Scanning files..." });
35
+ const allFiles = buildFileTree(context.rootDir, context.scopeDir);
36
+ const { files: annotatedFiles, languages } = detectLanguages(allFiles);
37
+ // Filter to requested languages if specified
38
+ let supportedFiles = filterToSupported(annotatedFiles);
39
+ if (options.languages && options.languages.length > 0) {
40
+ const langSet = new Set(options.languages);
41
+ supportedFiles = supportedFiles.filter((f) => f.language && langSet.has(f.language));
42
+ }
43
+ emit({
44
+ stage: "ingestion",
45
+ message: `Found ${supportedFiles.length} files in ${languages.join(", ")}`,
46
+ total: supportedFiles.length,
47
+ });
48
+ // 3. Initialize tree-sitter parser
49
+ emit({ stage: "parsing", message: "Initializing parser..." });
50
+ await initParser();
51
+ // 4. Parse all files (now includes function extraction and complexity)
52
+ const analyses = [];
53
+ for (let i = 0; i < supportedFiles.length; i++) {
54
+ const file = supportedFiles[i];
55
+ emit({
56
+ stage: "parsing",
57
+ message: `Parsing ${file.relativePath}`,
58
+ current: i + 1,
59
+ total: supportedFiles.length,
60
+ });
61
+ try {
62
+ const content = readFileSync(file.absolutePath, "utf-8");
63
+ const tree = await parseFile(content, file.language, file.absolutePath);
64
+ const visitor = getVisitor(file.language);
65
+ const analysis = visitor(content, tree, file.absolutePath);
66
+ analyses.push(analysis);
67
+ }
68
+ catch (err) {
69
+ logger.warn(`Failed to parse ${file.relativePath}: ${err}`);
70
+ }
71
+ }
72
+ // 5. Resolve imports
73
+ emit({ stage: "dependencies", message: "Resolving imports..." });
74
+ const tsConfig = loadTsConfigPaths(context.rootDir);
75
+ const resolvedAnalyses = resolveAllImports(analyses, context.rootDir, tsConfig);
76
+ // 6. Detect modules
77
+ emit({ stage: "modules", message: "Detecting modules..." });
78
+ const modules = detectModules(context.rootDir, context.scopeDir, supportedFiles, resolvedAnalyses);
79
+ // 7. Build dependency graph
80
+ emit({ stage: "dependencies", message: "Building dependency graph..." });
81
+ const { moduleEdges } = buildDependencyGraph(resolvedAnalyses, modules, context.rootDir);
82
+ // 7b. Build call graph (skip in quick mode)
83
+ let callGraphResult;
84
+ if (!options.quick) {
85
+ emit({ stage: "call_graph", message: "Building call graph..." });
86
+ const { buildCallGraph } = await import("./analysis/call-graph.js");
87
+ callGraphResult = buildCallGraph(resolvedAnalyses, modules, context.rootDir);
88
+ emit({
89
+ stage: "call_graph",
90
+ message: `Call graph: ${callGraphResult.functionNodes.length} functions, ${callGraphResult.callEdges.length} call edges`,
91
+ });
92
+ }
93
+ // 8. Compute metrics (now includes complexity, TODO count, doc coverage)
94
+ const fileMetrics = computeFileMetrics(resolvedAnalyses);
95
+ const moduleMetrics = computeModuleMetrics(modules, fileMetrics, context.rootDir);
96
+ // 9. Git archaeology (if enabled)
97
+ let gitResult;
98
+ if (!options.skipGit) {
99
+ const gitDir = existsSync(join(context.rootDir, ".git")) ? context.rootDir : null;
100
+ if (gitDir) {
101
+ emit({ stage: "git", message: "Analyzing git history..." });
102
+ try {
103
+ const { analyzeGitHistory } = await import("./analysis/git/archaeology.js");
104
+ const relPaths = supportedFiles.map((f) => f.relativePath);
105
+ gitResult = await analyzeGitHistory(gitDir, relPaths, modules);
106
+ emit({ stage: "git", message: `Git: ${gitResult.churnMap.size} files, ${gitResult.contributors.length} contributors` });
107
+ }
108
+ catch (err) {
109
+ logger.warn(`Git archaeology failed: ${err instanceof Error ? err.message : err}`);
110
+ }
111
+ }
112
+ else {
113
+ logger.debug("No .git directory found, skipping git archaeology");
114
+ }
115
+ }
116
+ // 10. Health scoring (skip in quick mode)
117
+ let healthScores;
118
+ if (!options.quick) {
119
+ emit({ stage: "health", message: "Computing health scores..." });
120
+ const { computeAllHealthScores } = await import("./analysis/health/scorer.js");
121
+ healthScores = computeAllHealthScores(resolvedAnalyses, fileMetrics, gitResult?.churnMap, allFiles);
122
+ }
123
+ // 11. Open SQLite database (moved earlier for LLM cache access)
124
+ const dbPath = join(context.outputDir, "cartographer.db");
125
+ const db = createDatabase(dbPath);
126
+ // 12. LLM summarization (if enabled)
127
+ let summarization;
128
+ if (!options.skipLlm) {
129
+ const apiKey = options.openaiApiKey ?? process.env["OPENAI_API_KEY"];
130
+ if (apiKey) {
131
+ emit({ stage: "llm", message: "Starting AI summarization..." });
132
+ try {
133
+ const { OpenAIClient } = await import("./analysis/semantic/openai-client.js");
134
+ const { summarizeHierarchically } = await import("./analysis/semantic/summarizer.js");
135
+ const client = new OpenAIClient({
136
+ apiKey,
137
+ maxConcurrency: options.llmConcurrency ?? 10,
138
+ });
139
+ summarization = await summarizeHierarchically(client, db, resolvedAnalyses, modules, moduleEdges, context.rootDir, (event) => emit(event));
140
+ emit({
141
+ stage: "llm",
142
+ message: `AI summarization complete (${summarization.totalTokensUsed} tokens used)`,
143
+ });
144
+ }
145
+ catch (err) {
146
+ logger.warn(`LLM summarization failed: ${err instanceof Error ? err.message : err}`);
147
+ }
148
+ }
149
+ else {
150
+ logger.warn("No OPENAI_API_KEY found, skipping LLM summarization");
151
+ }
152
+ }
153
+ // 13. Build graph (with all enriched data)
154
+ emit({ stage: "graph", message: "Building graph..." });
155
+ const { nodes, edges } = buildGraph({
156
+ modules,
157
+ analyses: resolvedAnalyses,
158
+ moduleEdges,
159
+ fileMetrics,
160
+ moduleMetrics,
161
+ rootDir: context.rootDir,
162
+ gitResult,
163
+ healthScores,
164
+ summarization,
165
+ callGraphResult,
166
+ });
167
+ // 14. Compute layout
168
+ emit({ stage: "layout", message: "Computing layout..." });
169
+ computeLayout(nodes, edges);
170
+ // 15. Persist to SQLite
171
+ emit({ stage: "export", message: "Saving to database..." });
172
+ insertNodes(db, nodes);
173
+ insertEdges(db, edges);
174
+ // 15b. Generate and persist expeditions
175
+ emit({ stage: "expeditions", message: "Generating expeditions..." });
176
+ let openaiClient;
177
+ if (!options.skipLlm) {
178
+ const apiKey = options.openaiApiKey ?? process.env["OPENAI_API_KEY"];
179
+ if (apiKey) {
180
+ const { OpenAIClient } = await import("./analysis/semantic/openai-client.js");
181
+ openaiClient = new OpenAIClient({
182
+ apiKey,
183
+ maxConcurrency: options.llmConcurrency ?? 10,
184
+ });
185
+ }
186
+ }
187
+ const { generateExpeditions } = await import("./expeditions/generator.js");
188
+ const expeditions = await generateExpeditions({
189
+ nodes,
190
+ edges,
191
+ callEdges: callGraphResult?.callEdges ?? [],
192
+ modules,
193
+ client: openaiClient,
194
+ db,
195
+ onProgress: (event) => emit(event),
196
+ });
197
+ if (expeditions.length > 0) {
198
+ insertExpeditions(db, expeditions);
199
+ emit({ stage: "expeditions", message: `Generated ${expeditions.length} expedition(s)` });
200
+ }
201
+ // 16. Export JSON
202
+ emit({ stage: "export", message: "Exporting graph..." });
203
+ const meta = {
204
+ repo: normalizePath(relative(process.cwd(), context.rootDir)) || context.rootDir,
205
+ analyzedAt: new Date().toISOString(),
206
+ languages,
207
+ totalFiles: supportedFiles.length,
208
+ totalModules: modules.length,
209
+ architectureStyle: summarization?.systemSummary?.architectureStyle ?? "unknown",
210
+ systemSummary: summarization?.systemSummary?.narrative ?? "",
211
+ };
212
+ const graph = exportGraph(db, meta);
213
+ // Add evolution data if available
214
+ if (gitResult?.evolution && gitResult.evolution.length > 0) {
215
+ graph.evolution = gitResult.evolution;
216
+ }
217
+ const jsonPath = join(context.outputDir, "graph.json");
218
+ writeGraphJSON(graph, jsonPath);
219
+ db.close();
220
+ emit({ stage: "export", message: "Done!" });
221
+ return graph;
222
+ }
223
+ //# sourceMappingURL=pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,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