@colbymchenry/codegraph 0.7.10 → 0.9.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 (362) hide show
  1. package/README.md +70 -54
  2. package/npm-shim.js +43 -0
  3. package/package.json +13 -51
  4. package/LICENSE +0 -21
  5. package/dist/bin/codegraph.d.ts +0 -21
  6. package/dist/bin/codegraph.d.ts.map +0 -1
  7. package/dist/bin/codegraph.js +0 -1232
  8. package/dist/bin/codegraph.js.map +0 -1
  9. package/dist/bin/node-version-check.d.ts +0 -20
  10. package/dist/bin/node-version-check.d.ts.map +0 -1
  11. package/dist/bin/node-version-check.js +0 -42
  12. package/dist/bin/node-version-check.js.map +0 -1
  13. package/dist/bin/uninstall.d.ts +0 -14
  14. package/dist/bin/uninstall.d.ts.map +0 -1
  15. package/dist/bin/uninstall.js +0 -36
  16. package/dist/bin/uninstall.js.map +0 -1
  17. package/dist/config.d.ts +0 -51
  18. package/dist/config.d.ts.map +0 -1
  19. package/dist/config.js +0 -321
  20. package/dist/config.js.map +0 -1
  21. package/dist/context/formatter.d.ts +0 -30
  22. package/dist/context/formatter.d.ts.map +0 -1
  23. package/dist/context/formatter.js +0 -244
  24. package/dist/context/formatter.js.map +0 -1
  25. package/dist/context/index.d.ts +0 -97
  26. package/dist/context/index.d.ts.map +0 -1
  27. package/dist/context/index.js +0 -1048
  28. package/dist/context/index.js.map +0 -1
  29. package/dist/db/index.d.ts +0 -72
  30. package/dist/db/index.d.ts.map +0 -1
  31. package/dist/db/index.js +0 -200
  32. package/dist/db/index.js.map +0 -1
  33. package/dist/db/migrations.d.ts +0 -44
  34. package/dist/db/migrations.d.ts.map +0 -1
  35. package/dist/db/migrations.js +0 -131
  36. package/dist/db/migrations.js.map +0 -1
  37. package/dist/db/queries.d.ts +0 -253
  38. package/dist/db/queries.d.ts.map +0 -1
  39. package/dist/db/queries.js +0 -1207
  40. package/dist/db/queries.js.map +0 -1
  41. package/dist/db/schema.sql +0 -151
  42. package/dist/db/sqlite-adapter.d.ts +0 -52
  43. package/dist/db/sqlite-adapter.d.ts.map +0 -1
  44. package/dist/db/sqlite-adapter.js +0 -237
  45. package/dist/db/sqlite-adapter.js.map +0 -1
  46. package/dist/directory.d.ts +0 -57
  47. package/dist/directory.d.ts.map +0 -1
  48. package/dist/directory.js +0 -264
  49. package/dist/directory.js.map +0 -1
  50. package/dist/errors.d.ts +0 -136
  51. package/dist/errors.d.ts.map +0 -1
  52. package/dist/errors.js +0 -219
  53. package/dist/errors.js.map +0 -1
  54. package/dist/extraction/dfm-extractor.d.ts +0 -31
  55. package/dist/extraction/dfm-extractor.d.ts.map +0 -1
  56. package/dist/extraction/dfm-extractor.js +0 -151
  57. package/dist/extraction/dfm-extractor.js.map +0 -1
  58. package/dist/extraction/grammars.d.ts +0 -78
  59. package/dist/extraction/grammars.d.ts.map +0 -1
  60. package/dist/extraction/grammars.js +0 -322
  61. package/dist/extraction/grammars.js.map +0 -1
  62. package/dist/extraction/index.d.ts +0 -130
  63. package/dist/extraction/index.d.ts.map +0 -1
  64. package/dist/extraction/index.js +0 -1279
  65. package/dist/extraction/index.js.map +0 -1
  66. package/dist/extraction/languages/c-cpp.d.ts +0 -4
  67. package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
  68. package/dist/extraction/languages/c-cpp.js +0 -126
  69. package/dist/extraction/languages/c-cpp.js.map +0 -1
  70. package/dist/extraction/languages/csharp.d.ts +0 -3
  71. package/dist/extraction/languages/csharp.d.ts.map +0 -1
  72. package/dist/extraction/languages/csharp.js +0 -72
  73. package/dist/extraction/languages/csharp.js.map +0 -1
  74. package/dist/extraction/languages/dart.d.ts +0 -3
  75. package/dist/extraction/languages/dart.d.ts.map +0 -1
  76. package/dist/extraction/languages/dart.js +0 -192
  77. package/dist/extraction/languages/dart.js.map +0 -1
  78. package/dist/extraction/languages/go.d.ts +0 -3
  79. package/dist/extraction/languages/go.d.ts.map +0 -1
  80. package/dist/extraction/languages/go.js +0 -58
  81. package/dist/extraction/languages/go.js.map +0 -1
  82. package/dist/extraction/languages/index.d.ts +0 -10
  83. package/dist/extraction/languages/index.d.ts.map +0 -1
  84. package/dist/extraction/languages/index.js +0 -45
  85. package/dist/extraction/languages/index.js.map +0 -1
  86. package/dist/extraction/languages/java.d.ts +0 -3
  87. package/dist/extraction/languages/java.d.ts.map +0 -1
  88. package/dist/extraction/languages/java.js +0 -64
  89. package/dist/extraction/languages/java.js.map +0 -1
  90. package/dist/extraction/languages/javascript.d.ts +0 -3
  91. package/dist/extraction/languages/javascript.d.ts.map +0 -1
  92. package/dist/extraction/languages/javascript.js +0 -90
  93. package/dist/extraction/languages/javascript.js.map +0 -1
  94. package/dist/extraction/languages/kotlin.d.ts +0 -3
  95. package/dist/extraction/languages/kotlin.d.ts.map +0 -1
  96. package/dist/extraction/languages/kotlin.js +0 -253
  97. package/dist/extraction/languages/kotlin.js.map +0 -1
  98. package/dist/extraction/languages/pascal.d.ts +0 -3
  99. package/dist/extraction/languages/pascal.d.ts.map +0 -1
  100. package/dist/extraction/languages/pascal.js +0 -66
  101. package/dist/extraction/languages/pascal.js.map +0 -1
  102. package/dist/extraction/languages/php.d.ts +0 -3
  103. package/dist/extraction/languages/php.d.ts.map +0 -1
  104. package/dist/extraction/languages/php.js +0 -107
  105. package/dist/extraction/languages/php.js.map +0 -1
  106. package/dist/extraction/languages/python.d.ts +0 -3
  107. package/dist/extraction/languages/python.d.ts.map +0 -1
  108. package/dist/extraction/languages/python.js +0 -56
  109. package/dist/extraction/languages/python.js.map +0 -1
  110. package/dist/extraction/languages/ruby.d.ts +0 -3
  111. package/dist/extraction/languages/ruby.d.ts.map +0 -1
  112. package/dist/extraction/languages/ruby.js +0 -114
  113. package/dist/extraction/languages/ruby.js.map +0 -1
  114. package/dist/extraction/languages/rust.d.ts +0 -3
  115. package/dist/extraction/languages/rust.d.ts.map +0 -1
  116. package/dist/extraction/languages/rust.js +0 -109
  117. package/dist/extraction/languages/rust.js.map +0 -1
  118. package/dist/extraction/languages/scala.d.ts +0 -3
  119. package/dist/extraction/languages/scala.d.ts.map +0 -1
  120. package/dist/extraction/languages/scala.js +0 -139
  121. package/dist/extraction/languages/scala.js.map +0 -1
  122. package/dist/extraction/languages/swift.d.ts +0 -3
  123. package/dist/extraction/languages/swift.d.ts.map +0 -1
  124. package/dist/extraction/languages/swift.js +0 -91
  125. package/dist/extraction/languages/swift.js.map +0 -1
  126. package/dist/extraction/languages/typescript.d.ts +0 -3
  127. package/dist/extraction/languages/typescript.d.ts.map +0 -1
  128. package/dist/extraction/languages/typescript.js +0 -129
  129. package/dist/extraction/languages/typescript.js.map +0 -1
  130. package/dist/extraction/liquid-extractor.d.ts +0 -52
  131. package/dist/extraction/liquid-extractor.d.ts.map +0 -1
  132. package/dist/extraction/liquid-extractor.js +0 -313
  133. package/dist/extraction/liquid-extractor.js.map +0 -1
  134. package/dist/extraction/parse-worker.d.ts +0 -8
  135. package/dist/extraction/parse-worker.d.ts.map +0 -1
  136. package/dist/extraction/parse-worker.js +0 -94
  137. package/dist/extraction/parse-worker.js.map +0 -1
  138. package/dist/extraction/svelte-extractor.d.ts +0 -56
  139. package/dist/extraction/svelte-extractor.d.ts.map +0 -1
  140. package/dist/extraction/svelte-extractor.js +0 -272
  141. package/dist/extraction/svelte-extractor.js.map +0 -1
  142. package/dist/extraction/tree-sitter-helpers.d.ts +0 -28
  143. package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
  144. package/dist/extraction/tree-sitter-helpers.js +0 -103
  145. package/dist/extraction/tree-sitter-helpers.js.map +0 -1
  146. package/dist/extraction/tree-sitter-types.d.ts +0 -179
  147. package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
  148. package/dist/extraction/tree-sitter-types.js +0 -10
  149. package/dist/extraction/tree-sitter-types.js.map +0 -1
  150. package/dist/extraction/tree-sitter.d.ts +0 -233
  151. package/dist/extraction/tree-sitter.d.ts.map +0 -1
  152. package/dist/extraction/tree-sitter.js +0 -2393
  153. package/dist/extraction/tree-sitter.js.map +0 -1
  154. package/dist/extraction/vue-extractor.d.ts +0 -36
  155. package/dist/extraction/vue-extractor.d.ts.map +0 -1
  156. package/dist/extraction/vue-extractor.js +0 -163
  157. package/dist/extraction/vue-extractor.js.map +0 -1
  158. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  159. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  160. package/dist/graph/index.d.ts +0 -8
  161. package/dist/graph/index.d.ts.map +0 -1
  162. package/dist/graph/index.js +0 -13
  163. package/dist/graph/index.js.map +0 -1
  164. package/dist/graph/queries.d.ts +0 -106
  165. package/dist/graph/queries.d.ts.map +0 -1
  166. package/dist/graph/queries.js +0 -366
  167. package/dist/graph/queries.js.map +0 -1
  168. package/dist/graph/traversal.d.ts +0 -127
  169. package/dist/graph/traversal.d.ts.map +0 -1
  170. package/dist/graph/traversal.js +0 -493
  171. package/dist/graph/traversal.js.map +0 -1
  172. package/dist/index.d.ts +0 -447
  173. package/dist/index.d.ts.map +0 -1
  174. package/dist/index.js +0 -825
  175. package/dist/index.js.map +0 -1
  176. package/dist/installer/claude-md-template.d.ts +0 -14
  177. package/dist/installer/claude-md-template.d.ts.map +0 -1
  178. package/dist/installer/claude-md-template.js +0 -21
  179. package/dist/installer/claude-md-template.js.map +0 -1
  180. package/dist/installer/config-writer.d.ts +0 -29
  181. package/dist/installer/config-writer.d.ts.map +0 -1
  182. package/dist/installer/config-writer.js +0 -109
  183. package/dist/installer/config-writer.js.map +0 -1
  184. package/dist/installer/index.d.ts +0 -53
  185. package/dist/installer/index.d.ts.map +0 -1
  186. package/dist/installer/index.js +0 -338
  187. package/dist/installer/index.js.map +0 -1
  188. package/dist/installer/instructions-template.d.ts +0 -28
  189. package/dist/installer/instructions-template.d.ts.map +0 -1
  190. package/dist/installer/instructions-template.js +0 -63
  191. package/dist/installer/instructions-template.js.map +0 -1
  192. package/dist/installer/targets/claude.d.ts +0 -27
  193. package/dist/installer/targets/claude.d.ts.map +0 -1
  194. package/dist/installer/targets/claude.js +0 -246
  195. package/dist/installer/targets/claude.js.map +0 -1
  196. package/dist/installer/targets/codex.d.ts +0 -18
  197. package/dist/installer/targets/codex.d.ts.map +0 -1
  198. package/dist/installer/targets/codex.js +0 -185
  199. package/dist/installer/targets/codex.js.map +0 -1
  200. package/dist/installer/targets/cursor.d.ts +0 -35
  201. package/dist/installer/targets/cursor.d.ts.map +0 -1
  202. package/dist/installer/targets/cursor.js +0 -229
  203. package/dist/installer/targets/cursor.js.map +0 -1
  204. package/dist/installer/targets/opencode.d.ts +0 -30
  205. package/dist/installer/targets/opencode.d.ts.map +0 -1
  206. package/dist/installer/targets/opencode.js +0 -235
  207. package/dist/installer/targets/opencode.js.map +0 -1
  208. package/dist/installer/targets/registry.d.ts +0 -35
  209. package/dist/installer/targets/registry.d.ts.map +0 -1
  210. package/dist/installer/targets/registry.js +0 -83
  211. package/dist/installer/targets/registry.js.map +0 -1
  212. package/dist/installer/targets/shared.d.ts +0 -77
  213. package/dist/installer/targets/shared.d.ts.map +0 -1
  214. package/dist/installer/targets/shared.js +0 -246
  215. package/dist/installer/targets/shared.js.map +0 -1
  216. package/dist/installer/targets/toml.d.ts +0 -52
  217. package/dist/installer/targets/toml.d.ts.map +0 -1
  218. package/dist/installer/targets/toml.js +0 -147
  219. package/dist/installer/targets/toml.js.map +0 -1
  220. package/dist/installer/targets/types.d.ts +0 -116
  221. package/dist/installer/targets/types.d.ts.map +0 -1
  222. package/dist/installer/targets/types.js +0 -16
  223. package/dist/installer/targets/types.js.map +0 -1
  224. package/dist/mcp/index.d.ts +0 -86
  225. package/dist/mcp/index.d.ts.map +0 -1
  226. package/dist/mcp/index.js +0 -355
  227. package/dist/mcp/index.js.map +0 -1
  228. package/dist/mcp/server-instructions.d.ts +0 -19
  229. package/dist/mcp/server-instructions.d.ts.map +0 -1
  230. package/dist/mcp/server-instructions.js +0 -59
  231. package/dist/mcp/server-instructions.js.map +0 -1
  232. package/dist/mcp/tools.d.ts +0 -200
  233. package/dist/mcp/tools.d.ts.map +0 -1
  234. package/dist/mcp/tools.js +0 -1319
  235. package/dist/mcp/tools.js.map +0 -1
  236. package/dist/mcp/transport.d.ts +0 -89
  237. package/dist/mcp/transport.d.ts.map +0 -1
  238. package/dist/mcp/transport.js +0 -170
  239. package/dist/mcp/transport.js.map +0 -1
  240. package/dist/resolution/frameworks/cargo-workspace.d.ts +0 -18
  241. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
  242. package/dist/resolution/frameworks/cargo-workspace.js +0 -225
  243. package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
  244. package/dist/resolution/frameworks/csharp.d.ts +0 -8
  245. package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
  246. package/dist/resolution/frameworks/csharp.js +0 -213
  247. package/dist/resolution/frameworks/csharp.js.map +0 -1
  248. package/dist/resolution/frameworks/express.d.ts +0 -8
  249. package/dist/resolution/frameworks/express.d.ts.map +0 -1
  250. package/dist/resolution/frameworks/express.js +0 -225
  251. package/dist/resolution/frameworks/express.js.map +0 -1
  252. package/dist/resolution/frameworks/go.d.ts +0 -8
  253. package/dist/resolution/frameworks/go.d.ts.map +0 -1
  254. package/dist/resolution/frameworks/go.js +0 -158
  255. package/dist/resolution/frameworks/go.js.map +0 -1
  256. package/dist/resolution/frameworks/index.d.ts +0 -41
  257. package/dist/resolution/frameworks/index.d.ts.map +0 -1
  258. package/dist/resolution/frameworks/index.js +0 -129
  259. package/dist/resolution/frameworks/index.js.map +0 -1
  260. package/dist/resolution/frameworks/java.d.ts +0 -8
  261. package/dist/resolution/frameworks/java.d.ts.map +0 -1
  262. package/dist/resolution/frameworks/java.js +0 -177
  263. package/dist/resolution/frameworks/java.js.map +0 -1
  264. package/dist/resolution/frameworks/laravel.d.ts +0 -13
  265. package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
  266. package/dist/resolution/frameworks/laravel.js +0 -248
  267. package/dist/resolution/frameworks/laravel.js.map +0 -1
  268. package/dist/resolution/frameworks/python.d.ts +0 -10
  269. package/dist/resolution/frameworks/python.d.ts.map +0 -1
  270. package/dist/resolution/frameworks/python.js +0 -278
  271. package/dist/resolution/frameworks/python.js.map +0 -1
  272. package/dist/resolution/frameworks/react.d.ts +0 -8
  273. package/dist/resolution/frameworks/react.d.ts.map +0 -1
  274. package/dist/resolution/frameworks/react.js +0 -272
  275. package/dist/resolution/frameworks/react.js.map +0 -1
  276. package/dist/resolution/frameworks/ruby.d.ts +0 -8
  277. package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
  278. package/dist/resolution/frameworks/ruby.js +0 -198
  279. package/dist/resolution/frameworks/ruby.js.map +0 -1
  280. package/dist/resolution/frameworks/rust.d.ts +0 -8
  281. package/dist/resolution/frameworks/rust.d.ts.map +0 -1
  282. package/dist/resolution/frameworks/rust.js +0 -207
  283. package/dist/resolution/frameworks/rust.js.map +0 -1
  284. package/dist/resolution/frameworks/svelte.d.ts +0 -9
  285. package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
  286. package/dist/resolution/frameworks/svelte.js +0 -249
  287. package/dist/resolution/frameworks/svelte.js.map +0 -1
  288. package/dist/resolution/frameworks/swift.d.ts +0 -10
  289. package/dist/resolution/frameworks/swift.d.ts.map +0 -1
  290. package/dist/resolution/frameworks/swift.js +0 -376
  291. package/dist/resolution/frameworks/swift.js.map +0 -1
  292. package/dist/resolution/frameworks/vue.d.ts +0 -9
  293. package/dist/resolution/frameworks/vue.d.ts.map +0 -1
  294. package/dist/resolution/frameworks/vue.js +0 -306
  295. package/dist/resolution/frameworks/vue.js.map +0 -1
  296. package/dist/resolution/import-resolver.d.ts +0 -40
  297. package/dist/resolution/import-resolver.d.ts.map +0 -1
  298. package/dist/resolution/import-resolver.js +0 -663
  299. package/dist/resolution/import-resolver.js.map +0 -1
  300. package/dist/resolution/index.d.ts +0 -106
  301. package/dist/resolution/index.d.ts.map +0 -1
  302. package/dist/resolution/index.js +0 -709
  303. package/dist/resolution/index.js.map +0 -1
  304. package/dist/resolution/name-matcher.d.ts +0 -32
  305. package/dist/resolution/name-matcher.d.ts.map +0 -1
  306. package/dist/resolution/name-matcher.js +0 -384
  307. package/dist/resolution/name-matcher.js.map +0 -1
  308. package/dist/resolution/path-aliases.d.ts +0 -68
  309. package/dist/resolution/path-aliases.d.ts.map +0 -1
  310. package/dist/resolution/path-aliases.js +0 -238
  311. package/dist/resolution/path-aliases.js.map +0 -1
  312. package/dist/resolution/strip-comments.d.ts +0 -27
  313. package/dist/resolution/strip-comments.d.ts.map +0 -1
  314. package/dist/resolution/strip-comments.js +0 -441
  315. package/dist/resolution/strip-comments.js.map +0 -1
  316. package/dist/resolution/types.d.ts +0 -172
  317. package/dist/resolution/types.d.ts.map +0 -1
  318. package/dist/resolution/types.js +0 -8
  319. package/dist/resolution/types.js.map +0 -1
  320. package/dist/search/query-parser.d.ts +0 -57
  321. package/dist/search/query-parser.d.ts.map +0 -1
  322. package/dist/search/query-parser.js +0 -177
  323. package/dist/search/query-parser.js.map +0 -1
  324. package/dist/search/query-utils.d.ts +0 -53
  325. package/dist/search/query-utils.d.ts.map +0 -1
  326. package/dist/search/query-utils.js +0 -347
  327. package/dist/search/query-utils.js.map +0 -1
  328. package/dist/sync/index.d.ts +0 -13
  329. package/dist/sync/index.d.ts.map +0 -1
  330. package/dist/sync/index.js +0 -17
  331. package/dist/sync/index.js.map +0 -1
  332. package/dist/sync/watcher.d.ts +0 -81
  333. package/dist/sync/watcher.d.ts.map +0 -1
  334. package/dist/sync/watcher.js +0 -184
  335. package/dist/sync/watcher.js.map +0 -1
  336. package/dist/types.d.ts +0 -423
  337. package/dist/types.d.ts.map +0 -1
  338. package/dist/types.js +0 -256
  339. package/dist/types.js.map +0 -1
  340. package/dist/ui/glyphs.d.ts +0 -42
  341. package/dist/ui/glyphs.d.ts.map +0 -1
  342. package/dist/ui/glyphs.js +0 -78
  343. package/dist/ui/glyphs.js.map +0 -1
  344. package/dist/ui/shimmer-progress.d.ts +0 -11
  345. package/dist/ui/shimmer-progress.d.ts.map +0 -1
  346. package/dist/ui/shimmer-progress.js +0 -90
  347. package/dist/ui/shimmer-progress.js.map +0 -1
  348. package/dist/ui/shimmer-worker.d.ts +0 -2
  349. package/dist/ui/shimmer-worker.d.ts.map +0 -1
  350. package/dist/ui/shimmer-worker.js +0 -118
  351. package/dist/ui/shimmer-worker.js.map +0 -1
  352. package/dist/ui/types.d.ts +0 -17
  353. package/dist/ui/types.d.ts.map +0 -1
  354. package/dist/ui/types.js +0 -3
  355. package/dist/ui/types.js.map +0 -1
  356. package/dist/utils.d.ts +0 -205
  357. package/dist/utils.d.ts.map +0 -1
  358. package/dist/utils.js +0 -549
  359. package/dist/utils.js.map +0 -1
  360. package/scripts/local-install.sh +0 -41
  361. package/scripts/patch-tree-sitter-dart.js +0 -112
  362. package/scripts/release.sh +0 -70
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;;;;;GAMG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,WAAW;IACX,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,OAAO;IACP,UAAU;IACV,UAAU;IACV,MAAM;IACN,aAAa;IACb,YAAY;IACZ,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,WAAW;CACH,CAAC;AAqBX;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,YAAY;IACZ,YAAY;IACZ,KAAK;IACL,KAAK;IACL,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,MAAM;IACN,GAAG;IACH,KAAK;IACL,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,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
- * Glyph selection for CLI output.
3
- *
4
- * On Windows, console output is interpreted via the active output
5
- * codepage. PowerShell 5.1 and cmd.exe default to OEM codepages
6
- * (CP437, CP936, ...), so UTF-8 bytes written to the console render
7
- * as mojibake (see #168). The shimmer worker is hit hardest because
8
- * it uses `fs.writeSync(1, ...)` (raw bytes, no TTY-aware encoding
9
- * conversion) to keep animation smooth while the main thread is
10
- * blocked in SQLite. To stay readable everywhere, we fall back to
11
- * ASCII glyphs whenever the terminal is not known to handle UTF-8.
12
- *
13
- * Detection is intentionally simple:
14
- * - `CODEGRAPH_ASCII=1` -> ASCII (escape hatch for any terminal)
15
- * - `CODEGRAPH_UNICODE=1` -> Unicode (opt-in on Windows)
16
- * - Windows -> ASCII by default
17
- * - Linux kernel console (`TERM=linux`) -> ASCII
18
- * - Everything else -> Unicode
19
- */
20
- export declare function supportsUnicode(): boolean;
21
- export interface Glyphs {
22
- ok: string;
23
- err: string;
24
- info: string;
25
- warn: string;
26
- spinner: string[];
27
- barFilled: string;
28
- barEmpty: string;
29
- rail: string;
30
- phaseDone: string;
31
- dash: string;
32
- hLine: string;
33
- treeBranch: string;
34
- treeLast: string;
35
- treePipe: string;
36
- }
37
- export declare const UNICODE_GLYPHS: Glyphs;
38
- export declare const ASCII_GLYPHS: Glyphs;
39
- export declare function getGlyphs(): Glyphs;
40
- /** Reset the cached glyph set. Test-only; production code should call `getGlyphs()`. */
41
- export declare function _resetGlyphsCache(): void;
42
- //# sourceMappingURL=glyphs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../../src/ui/glyphs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,eAAe,IAAI,OAAO,CAKzC;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,EAAE,MAe5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAe1B,CAAC;AAIF,wBAAgB,SAAS,IAAI,MAAM,CAKlC;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
package/dist/ui/glyphs.js DELETED
@@ -1,78 +0,0 @@
1
- "use strict";
2
- /**
3
- * Glyph selection for CLI output.
4
- *
5
- * On Windows, console output is interpreted via the active output
6
- * codepage. PowerShell 5.1 and cmd.exe default to OEM codepages
7
- * (CP437, CP936, ...), so UTF-8 bytes written to the console render
8
- * as mojibake (see #168). The shimmer worker is hit hardest because
9
- * it uses `fs.writeSync(1, ...)` (raw bytes, no TTY-aware encoding
10
- * conversion) to keep animation smooth while the main thread is
11
- * blocked in SQLite. To stay readable everywhere, we fall back to
12
- * ASCII glyphs whenever the terminal is not known to handle UTF-8.
13
- *
14
- * Detection is intentionally simple:
15
- * - `CODEGRAPH_ASCII=1` -> ASCII (escape hatch for any terminal)
16
- * - `CODEGRAPH_UNICODE=1` -> Unicode (opt-in on Windows)
17
- * - Windows -> ASCII by default
18
- * - Linux kernel console (`TERM=linux`) -> ASCII
19
- * - Everything else -> Unicode
20
- */
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.ASCII_GLYPHS = exports.UNICODE_GLYPHS = void 0;
23
- exports.supportsUnicode = supportsUnicode;
24
- exports.getGlyphs = getGlyphs;
25
- exports._resetGlyphsCache = _resetGlyphsCache;
26
- function supportsUnicode() {
27
- if (process.env.CODEGRAPH_ASCII === '1')
28
- return false;
29
- if (process.env.CODEGRAPH_UNICODE === '1')
30
- return true;
31
- if (process.platform === 'win32')
32
- return false;
33
- return process.env.TERM !== 'linux';
34
- }
35
- exports.UNICODE_GLYPHS = {
36
- ok: '✓',
37
- err: '✗',
38
- info: 'ℹ',
39
- warn: '⚠',
40
- spinner: ['·', '✢', '✳', '✶', '✻', '✽'],
41
- barFilled: '█',
42
- barEmpty: '░',
43
- rail: '│',
44
- phaseDone: '◆',
45
- dash: '—',
46
- hLine: '─',
47
- treeBranch: '├── ',
48
- treeLast: '└── ',
49
- treePipe: '│ ',
50
- };
51
- exports.ASCII_GLYPHS = {
52
- ok: '[OK]',
53
- err: '[ERR]',
54
- info: '[i]',
55
- warn: '[!]',
56
- spinner: ['.', '*', '+', 'x', 'o', 'O'],
57
- barFilled: '#',
58
- barEmpty: '-',
59
- rail: '|',
60
- phaseDone: '*',
61
- dash: '-',
62
- hLine: '-',
63
- treeBranch: '|-- ',
64
- treeLast: '`-- ',
65
- treePipe: '| ',
66
- };
67
- let cached = null;
68
- function getGlyphs() {
69
- if (cached === null) {
70
- cached = supportsUnicode() ? exports.UNICODE_GLYPHS : exports.ASCII_GLYPHS;
71
- }
72
- return cached;
73
- }
74
- /** Reset the cached glyph set. Test-only; production code should call `getGlyphs()`. */
75
- function _resetGlyphsCache() {
76
- cached = null;
77
- }
78
- //# sourceMappingURL=glyphs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glyphs.js","sourceRoot":"","sources":["../../src/ui/glyphs.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,0CAKC;AAuDD,8BAKC;AAGD,8CAEC;AAtED,SAAgB,eAAe;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,KA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AAC;IAC7D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,wFAAwF;AACxF,SAAgB,iBAAiB;IAC/B,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC"}
@@ -1,11 +0,0 @@
1
- export interface IndexProgress {
2
- phase: string;
3
- current: number;
4
- total: number;
5
- }
6
- export interface ShimmerProgress {
7
- onProgress: (progress: IndexProgress) => void;
8
- stop: () => Promise<void>;
9
- }
10
- export declare function createShimmerProgress(): ShimmerProgress;
11
- //# sourceMappingURL=shimmer-progress.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shimmer-progress.d.ts","sourceRoot":"","sources":["../../src/ui/shimmer-progress.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CAmDvD"}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.createShimmerProgress = createShimmerProgress;
37
- const worker_threads_1 = require("worker_threads");
38
- const path = __importStar(require("path"));
39
- const PHASE_NAMES = {
40
- scanning: 'Scanning files',
41
- parsing: 'Parsing code',
42
- storing: 'Storing data',
43
- resolving: 'Resolving refs',
44
- };
45
- function createShimmerProgress() {
46
- let lastPhase = '';
47
- const workerPath = path.join(__dirname, 'shimmer-worker.js');
48
- const worker = new worker_threads_1.Worker(workerPath, {
49
- workerData: { startTime: Date.now() },
50
- });
51
- return {
52
- onProgress(progress) {
53
- const phaseName = PHASE_NAMES[progress.phase] || progress.phase;
54
- if (progress.phase !== lastPhase && lastPhase) {
55
- worker.postMessage({ type: 'finish-phase' });
56
- }
57
- lastPhase = progress.phase;
58
- let percent = -1;
59
- let count = 0;
60
- if (progress.total > 0) {
61
- percent = Math.round((progress.current / progress.total) * 100);
62
- }
63
- else if (progress.current > 0) {
64
- count = progress.current;
65
- }
66
- worker.postMessage({
67
- type: 'update',
68
- phase: progress.phase,
69
- phaseName,
70
- percent,
71
- count,
72
- });
73
- },
74
- stop() {
75
- return new Promise((resolve) => {
76
- const timeout = setTimeout(() => {
77
- worker.terminate().then(() => resolve());
78
- }, 2000);
79
- worker.on('message', (msg) => {
80
- if (msg.type === 'stopped') {
81
- clearTimeout(timeout);
82
- worker.terminate().then(() => resolve());
83
- }
84
- });
85
- worker.postMessage({ type: 'stop' });
86
- });
87
- },
88
- };
89
- }
90
- //# sourceMappingURL=shimmer-progress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shimmer-progress.js","sourceRoot":"","sources":["../../src/ui/shimmer-progress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,sDAmDC;AAxED,mDAAwC;AACxC,2CAA6B;AAE7B,MAAM,WAAW,GAA2B;IAC1C,QAAQ,EAAE,gBAAgB;IAC1B,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;CAC5B,CAAC;AAaF,SAAgB,qBAAqB;IACnC,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,IAAI,uBAAM,CAAC,UAAU,EAAE;QACpC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;KACtC,CAAC,CAAC;IAEH,OAAO;QACL,UAAU,CAAC,QAAuB;YAChC,MAAM,SAAS,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC;YAEhE,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,SAAS,EAAE,CAAC;gBAC9C,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;YAC/C,CAAC;YACD,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC;YAE3B,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC;YACjB,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;gBACvB,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;YAClE,CAAC;iBAAM,IAAI,QAAQ,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;gBAChC,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC;YAC3B,CAAC;YAED,MAAM,CAAC,WAAW,CAAC;gBACjB,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,SAAS;gBACT,OAAO;gBACP,KAAK;aACN,CAAC,CAAC;QACL,CAAC;QAED,IAAI;YACF,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBACnC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;oBAC9B,MAAM,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC3C,CAAC,EAAE,IAAI,CAAC,CAAC;gBAET,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAqB,EAAE,EAAE;oBAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;wBAC3B,YAAY,CAAC,OAAO,CAAC,CAAC;wBACtB,MAAM,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;oBAC3C,CAAC;gBACH,CAAC,CAAC,CAAC;gBAEH,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=shimmer-worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shimmer-worker.d.ts","sourceRoot":"","sources":["../../src/ui/shimmer-worker.ts"],"names":[],"mappings":""}
@@ -1,118 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const worker_threads_1 = require("worker_threads");
4
- const fs_1 = require("fs");
5
- const glyphs_1 = require("./glyphs");
6
- // Write directly to fd 1 (stdout) instead of writeStdout().
7
- // In Node.js worker threads, process.stdout is proxied through the main
8
- // thread's event loop — so if the main thread is blocked (e.g. SQLite),
9
- // stdout writes from the worker queue up and the animation freezes.
10
- // fs.writeSync(1, ...) is a direct kernel syscall that bypasses this.
11
- //
12
- // Side effect: bypasses Node's TTY-aware encoding conversion on Windows,
13
- // so UTF-8 bytes hit the console raw and mojibake on OEM codepages.
14
- // `getGlyphs()` returns ASCII fallbacks on Windows to avoid this (#168).
15
- function writeStdout(s) {
16
- (0, fs_1.writeSync)(1, s);
17
- }
18
- const G = (0, glyphs_1.getGlyphs)();
19
- const SPINNER_GLYPHS = G.spinner;
20
- const ANIM_INTERVAL = 150;
21
- const FRAMES_PER_GLYPH = 3;
22
- const RST = '\x1b[0m';
23
- const DM = '\x1b[2m';
24
- const GRN = '\x1b[32m';
25
- const BOLD = '\x1b[1m';
26
- const startTime = worker_threads_1.workerData.startTime;
27
- function animFrame() {
28
- return Math.floor((Date.now() - startTime) / ANIM_INTERVAL);
29
- }
30
- function lerp(a, b, t) {
31
- return Math.round(a + (b - a) * t);
32
- }
33
- function shimmerColor(frame) {
34
- const t = (Math.sin(frame * 2 * Math.PI / 13) + 1) / 2;
35
- const r = lerp(160, 251, t);
36
- const g = lerp(100, 191, t);
37
- const b = lerp(9, 36, t);
38
- return `\x1b[38;2;${r};${g};${b}m${BOLD}`;
39
- }
40
- function formatNumber(n) {
41
- return n.toLocaleString();
42
- }
43
- function renderBar(frame, filled, empty) {
44
- if (filled === 0)
45
- return `${DM}${G.barEmpty.repeat(empty)}${RST}`;
46
- const cycleFrames = 24;
47
- const shimmerPos = ((frame % cycleFrames) / cycleFrames) * (filled + 6) - 3;
48
- const shimmerWidth = 3;
49
- let bar = '';
50
- for (let i = 0; i < filled; i++) {
51
- const dist = Math.abs(i - shimmerPos);
52
- const t = Math.max(0, 1 - dist / shimmerWidth);
53
- const r = lerp(160, 251, t);
54
- const g = lerp(100, 191, t);
55
- const b = lerp(9, 36, t);
56
- bar += `\x1b[38;2;${r};${g};${b}m${BOLD}${G.barFilled}`;
57
- }
58
- bar += `${RST}${DM}${G.barEmpty.repeat(empty)}${RST}`;
59
- return bar;
60
- }
61
- // Mutable state
62
- let currentMessage = '';
63
- let currentPercent = -1;
64
- let currentCount = 0;
65
- function render() {
66
- if (!currentMessage)
67
- return;
68
- const frame = animFrame();
69
- const glyphIdx = Math.floor(frame / FRAMES_PER_GLYPH) % SPINNER_GLYPHS.length;
70
- const glyph = SPINNER_GLYPHS[glyphIdx] ?? SPINNER_GLYPHS[0] ?? '.';
71
- const color = shimmerColor(frame);
72
- let line;
73
- if (currentPercent >= 0) {
74
- const barWidth = 25;
75
- const filled = Math.round(barWidth * currentPercent / 100);
76
- const empty = barWidth - filled;
77
- line = `${DM}${G.rail}${RST} ${color}${glyph}${RST} ${currentMessage} ${renderBar(frame, filled, empty)} ${currentPercent}%`;
78
- }
79
- else if (currentCount > 0) {
80
- line = `${DM}${G.rail}${RST} ${color}${glyph}${RST} ${currentMessage}... ${formatNumber(currentCount)} found`;
81
- }
82
- else {
83
- line = `${DM}${G.rail}${RST} ${color}${glyph}${RST} ${currentMessage}...`;
84
- }
85
- writeStdout(`\r\x1b[K${line}`);
86
- }
87
- function finishPhase() {
88
- if (!currentMessage)
89
- return;
90
- writeStdout(`\r\x1b[K`);
91
- let detail = '';
92
- if (currentPercent >= 0)
93
- detail = ` ${G.dash} done`;
94
- else if (currentCount > 0)
95
- detail = ` ${G.dash} ${formatNumber(currentCount)} found`;
96
- writeStdout(`${DM}${G.rail}${RST} ${GRN}${G.phaseDone}${RST} ${currentMessage}${detail}\n`);
97
- currentMessage = '';
98
- currentPercent = -1;
99
- currentCount = 0;
100
- }
101
- // Render loop — independent of main thread
102
- const tickInterval = setInterval(render, 50);
103
- worker_threads_1.parentPort.on('message', (msg) => {
104
- if (msg.type === 'update') {
105
- currentMessage = msg.phaseName;
106
- currentPercent = msg.percent;
107
- currentCount = msg.count;
108
- }
109
- else if (msg.type === 'finish-phase') {
110
- finishPhase();
111
- }
112
- else if (msg.type === 'stop') {
113
- clearInterval(tickInterval);
114
- finishPhase();
115
- worker_threads_1.parentPort.postMessage({ type: 'stopped' });
116
- }
117
- });
118
- //# sourceMappingURL=shimmer-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shimmer-worker.js","sourceRoot":"","sources":["../../src/ui/shimmer-worker.ts"],"names":[],"mappings":";;AAAA,mDAAwD;AACxD,2BAA+B;AAC/B,qCAAqC;AAGrC,4DAA4D;AAC5D,wEAAwE;AACxE,wEAAwE;AACxE,oEAAoE;AACpE,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,oEAAoE;AACpE,yEAAyE;AACzE,SAAS,WAAW,CAAC,CAAS;IAC5B,IAAA,cAAS,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,GAAG,IAAA,kBAAS,GAAE,CAAC;AACtB,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC;AACjC,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,EAAE,GAAG,SAAS,CAAC;AACrB,MAAM,GAAG,GAAG,UAAU,CAAC;AACvB,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB,MAAM,SAAS,GAAW,2BAAU,CAAC,SAAS,CAAC;AAE/C,SAAS,SAAS;IAChB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAA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C;IACpB,cAAc,GAAG,CAAC,CAAC,CAAC;IACpB,YAAY,GAAG,CAAC,CAAC;AACnB,CAAC;AAED,2CAA2C;AAC3C,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE7C,2BAAW,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAyB,EAAE,EAAE;IACtD,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC1B,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC;QAC/B,cAAc,GAAG,GAAG,CAAC,OAAO,CAAC;QAC7B,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC;IAC3B,CAAC;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QACvC,WAAW,EAAE,CAAC;IAChB,CAAC;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC/B,aAAa,CAAC,YAAY,CAAC,CAAC;QAC5B,WAAW,EAAE,CAAC;QACd,2BAAW,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- /** Messages from main thread to worker */
2
- export type ShimmerWorkerMessage = {
3
- type: 'update';
4
- phase: string;
5
- phaseName: string;
6
- percent: number;
7
- count: number;
8
- } | {
9
- type: 'finish-phase';
10
- } | {
11
- type: 'stop';
12
- };
13
- /** Messages from worker to main thread */
14
- export type ShimmerMainMessage = {
15
- type: 'stopped';
16
- };
17
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ui/types.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpF;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB,0CAA0C;AAC1C,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC"}
package/dist/ui/types.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ui/types.ts"],"names":[],"mappings":""}
package/dist/utils.d.ts DELETED
@@ -1,205 +0,0 @@
1
- /**
2
- * CodeGraph Utilities
3
- *
4
- * Common utility functions for memory management, concurrency, batching,
5
- * and security validation.
6
- *
7
- * @module utils
8
- *
9
- * @example
10
- * ```typescript
11
- * import { Mutex, processInBatches, MemoryMonitor, validatePathWithinRoot } from 'codegraph';
12
- *
13
- * // Use mutex for concurrent safety
14
- * const mutex = new Mutex();
15
- * await mutex.withLock(async () => {
16
- * await performCriticalOperation();
17
- * });
18
- *
19
- * // Process items in batches to manage memory
20
- * const results = await processInBatches(items, 100, async (item) => {
21
- * return await processItem(item);
22
- * });
23
- *
24
- * // Monitor memory usage
25
- * const monitor = new MemoryMonitor(512, (usage) => {
26
- * console.warn(`Memory usage exceeded 512MB: ${usage / 1024 / 1024}MB`);
27
- * });
28
- * monitor.start();
29
- * ```
30
- */
31
- /**
32
- * Validate that a resolved file path stays within the project root.
33
- * Prevents path traversal attacks (e.g. node.filePath = "../../etc/passwd").
34
- *
35
- * @param projectRoot - The project root directory
36
- * @param filePath - The relative file path to validate
37
- * @returns The resolved absolute path, or null if it escapes the root
38
- */
39
- export declare function validatePathWithinRoot(projectRoot: string, filePath: string): string | null;
40
- /**
41
- * Validate that a path is a safe project root directory.
42
- *
43
- * Rejects sensitive system directories and ensures the path is
44
- * a real, existing directory. Used at MCP and API entry points
45
- * to prevent arbitrary directory access.
46
- *
47
- * @param dirPath - The path to validate
48
- * @returns An error message if invalid, or null if valid
49
- */
50
- export declare function validateProjectPath(dirPath: string): string | null;
51
- /**
52
- * Check if a file path resolves to a location within the given root directory.
53
- *
54
- * Prevents path traversal attacks by ensuring the resolved absolute path
55
- * starts with the resolved root path. Handles '..' sequences, symlink-like
56
- * relative paths, and platform-specific separators.
57
- *
58
- * @param filePath - The path to check (can be relative or absolute)
59
- * @param rootDir - The root directory that filePath must stay within
60
- * @returns true if filePath resolves to a location within rootDir
61
- */
62
- export declare function isPathWithinRoot(filePath: string, rootDir: string): boolean;
63
- /**
64
- * Like isPathWithinRoot but also resolves symlinks via fs.realpathSync.
65
- *
66
- * This catches symlink escapes where the logical path appears to be within
67
- * root but the real path on disk points elsewhere. Falls back to logical
68
- * path checking if realpath resolution fails (e.g. broken symlink).
69
- */
70
- export declare function isPathWithinRootReal(filePath: string, rootDir: string): boolean;
71
- /**
72
- * Safely parse JSON with a fallback value.
73
- * Prevents crashes from corrupted database metadata.
74
- */
75
- export declare function safeJsonParse<T>(value: string, fallback: T): T;
76
- /**
77
- * Clamp a numeric value to a range.
78
- * Used to enforce sane limits on MCP tool inputs.
79
- */
80
- export declare function clamp(value: number, min: number, max: number): number;
81
- /**
82
- * Normalize a file path to use forward slashes.
83
- * Fixes Windows backslash paths so glob matching works consistently.
84
- */
85
- export declare function normalizePath(filePath: string): string;
86
- /**
87
- * Cross-process file lock using a lock file with PID tracking.
88
- *
89
- * Prevents multiple processes (e.g., git hooks, CLI, MCP server) from
90
- * writing to the same database simultaneously.
91
- */
92
- export declare class FileLock {
93
- private lockPath;
94
- private held;
95
- /** Locks older than this are considered stale regardless of PID status */
96
- private static readonly STALE_TIMEOUT_MS;
97
- constructor(lockPath: string);
98
- /**
99
- * Acquire the lock. Throws if the lock is held by another live process.
100
- */
101
- acquire(): void;
102
- /**
103
- * Release the lock
104
- */
105
- release(): void;
106
- /**
107
- * Execute a function while holding the lock
108
- */
109
- withLock<T>(fn: () => T): T;
110
- /**
111
- * Execute an async function while holding the lock
112
- */
113
- withLockAsync<T>(fn: () => Promise<T>): Promise<T>;
114
- /**
115
- * Check if a process is still running
116
- */
117
- private isProcessAlive;
118
- }
119
- /**
120
- * Process items in batches to manage memory
121
- *
122
- * @param items - Array of items to process
123
- * @param batchSize - Number of items per batch
124
- * @param processor - Function to process each item
125
- * @param onBatchComplete - Optional callback after each batch
126
- * @returns Array of results
127
- */
128
- export declare function processInBatches<T, R>(items: T[], batchSize: number, processor: (item: T, index: number) => Promise<R>, onBatchComplete?: (completed: number, total: number) => void): Promise<R[]>;
129
- /**
130
- * Simple mutex lock for preventing concurrent operations
131
- */
132
- export declare class Mutex {
133
- private locked;
134
- private waitQueue;
135
- /**
136
- * Acquire the lock
137
- *
138
- * @returns A release function to call when done
139
- */
140
- acquire(): Promise<() => void>;
141
- /**
142
- * Execute a function while holding the lock
143
- */
144
- withLock<T>(fn: () => Promise<T> | T): Promise<T>;
145
- /**
146
- * Check if the lock is currently held
147
- */
148
- isLocked(): boolean;
149
- }
150
- /**
151
- * Chunked file reader for large files
152
- *
153
- * Reads a file in chunks to avoid loading entire file into memory.
154
- */
155
- export declare function readFileInChunks(filePath: string, chunkSize?: number): AsyncGenerator<string, void, undefined>;
156
- /**
157
- * Debounce a function
158
- *
159
- * @param fn - Function to debounce
160
- * @param delay - Delay in milliseconds
161
- * @returns Debounced function
162
- */
163
- export declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, delay: number): (...args: Parameters<T>) => void;
164
- /**
165
- * Throttle a function
166
- *
167
- * @param fn - Function to throttle
168
- * @param limit - Minimum time between calls in milliseconds
169
- * @returns Throttled function
170
- */
171
- export declare function throttle<T extends (...args: unknown[]) => unknown>(fn: T, limit: number): (...args: Parameters<T>) => void;
172
- /**
173
- * Estimate memory usage of an object (rough approximation)
174
- *
175
- * @param obj - Object to measure
176
- * @returns Approximate size in bytes
177
- */
178
- export declare function estimateSize(obj: unknown): number;
179
- /**
180
- * Memory monitor for tracking usage during operations
181
- */
182
- export declare class MemoryMonitor {
183
- private checkInterval;
184
- private peakUsage;
185
- private threshold;
186
- private onThresholdExceeded?;
187
- constructor(thresholdMB?: number, onThresholdExceeded?: (usage: number) => void);
188
- /**
189
- * Start monitoring memory usage
190
- */
191
- start(intervalMs?: number): void;
192
- /**
193
- * Stop monitoring
194
- */
195
- stop(): void;
196
- /**
197
- * Get peak memory usage in bytes
198
- */
199
- getPeakUsage(): number;
200
- /**
201
- * Get current memory usage in bytes
202
- */
203
- getCurrentUsage(): number;
204
- }
205
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAmBH;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA6BlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAI3E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAe/E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAM9D;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MA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