gitnexus 1.6.4-rc.10 → 1.6.4-rc.101

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 (373) hide show
  1. package/README.md +35 -0
  2. package/dist/_shared/index.d.ts +2 -0
  3. package/dist/_shared/index.d.ts.map +1 -1
  4. package/dist/_shared/index.js +2 -0
  5. package/dist/_shared/index.js.map +1 -1
  6. package/dist/_shared/integrations/understand-quickly.d.ts +79 -0
  7. package/dist/_shared/integrations/understand-quickly.d.ts.map +1 -0
  8. package/dist/_shared/integrations/understand-quickly.js +139 -0
  9. package/dist/_shared/integrations/understand-quickly.js.map +1 -0
  10. package/dist/_shared/scope-resolution/finalize-algorithm.d.ts +11 -9
  11. package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -1
  12. package/dist/_shared/scope-resolution/finalize-algorithm.js +91 -36
  13. package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
  14. package/dist/cli/ai-context.js +2 -1
  15. package/dist/cli/analyze.d.ts +14 -1
  16. package/dist/cli/analyze.js +223 -40
  17. package/dist/cli/clean.js +4 -3
  18. package/dist/cli/cli-message.d.ts +15 -0
  19. package/dist/cli/cli-message.js +61 -0
  20. package/dist/cli/doctor.d.ts +1 -0
  21. package/dist/cli/doctor.js +31 -0
  22. package/dist/cli/eval-server.js +37 -12
  23. package/dist/cli/group.js +4 -3
  24. package/dist/cli/index-repo.js +2 -2
  25. package/dist/cli/index.js +25 -2
  26. package/dist/cli/mcp.d.ts +21 -0
  27. package/dist/cli/mcp.js +52 -15
  28. package/dist/cli/optional-grammars.d.ts +47 -0
  29. package/dist/cli/optional-grammars.js +87 -0
  30. package/dist/cli/publish.d.ts +29 -0
  31. package/dist/cli/publish.js +174 -0
  32. package/dist/cli/remove.js +7 -4
  33. package/dist/cli/serve.js +31 -13
  34. package/dist/cli/setup.js +46 -16
  35. package/dist/cli/tool.js +6 -5
  36. package/dist/cli/wiki.js +39 -6
  37. package/dist/config/ignore-service.js +4 -1
  38. package/dist/core/augmentation/engine.js +1 -1
  39. package/dist/core/embedding-mode.d.ts +21 -0
  40. package/dist/core/embedding-mode.js +18 -0
  41. package/dist/core/embeddings/config.d.ts +2 -0
  42. package/dist/core/embeddings/config.js +36 -0
  43. package/dist/core/embeddings/embedder.js +55 -27
  44. package/dist/core/embeddings/embedding-pipeline.d.ts +7 -1
  45. package/dist/core/embeddings/embedding-pipeline.js +106 -40
  46. package/dist/core/embeddings/exact-search.d.ts +15 -0
  47. package/dist/core/embeddings/exact-search.js +27 -0
  48. package/dist/core/embeddings/hf-env.d.ts +163 -0
  49. package/dist/core/embeddings/hf-env.js +250 -0
  50. package/dist/core/embeddings/types.d.ts +4 -0
  51. package/dist/core/embeddings/types.js +2 -0
  52. package/dist/core/git-staleness.d.ts +6 -0
  53. package/dist/core/git-staleness.js +35 -5
  54. package/dist/core/group/bridge-db.js +318 -170
  55. package/dist/core/group/config-parser.js +23 -1
  56. package/dist/core/group/cross-impact.d.ts +44 -0
  57. package/dist/core/group/cross-impact.js +82 -8
  58. package/dist/core/group/extractors/elixir-workspace-extractor.d.ts +15 -0
  59. package/dist/core/group/extractors/elixir-workspace-extractor.js +204 -0
  60. package/dist/core/group/extractors/go-workspace-extractor.d.ts +14 -0
  61. package/dist/core/group/extractors/go-workspace-extractor.js +217 -0
  62. package/dist/core/group/extractors/grpc-extractor.js +15 -3
  63. package/dist/core/group/extractors/http-route-extractor.js +9 -1
  64. package/dist/core/group/extractors/include-extractor.d.ts +39 -0
  65. package/dist/core/group/extractors/include-extractor.js +565 -0
  66. package/dist/core/group/extractors/java-workspace-extractor.d.ts +16 -0
  67. package/dist/core/group/extractors/java-workspace-extractor.js +204 -0
  68. package/dist/core/group/extractors/manifest-extractor.js +34 -6
  69. package/dist/core/group/extractors/node-workspace-extractor.d.ts +14 -0
  70. package/dist/core/group/extractors/node-workspace-extractor.js +207 -0
  71. package/dist/core/group/extractors/python-workspace-extractor.d.ts +15 -0
  72. package/dist/core/group/extractors/python-workspace-extractor.js +205 -0
  73. package/dist/core/group/extractors/rust-workspace-extractor.d.ts +44 -0
  74. package/dist/core/group/extractors/rust-workspace-extractor.js +240 -0
  75. package/dist/core/group/extractors/thrift-extractor.d.ts +22 -0
  76. package/dist/core/group/extractors/thrift-extractor.js +282 -0
  77. package/dist/core/group/extractors/thrift-patterns/index.d.ts +4 -0
  78. package/dist/core/group/extractors/thrift-patterns/index.js +10 -0
  79. package/dist/core/group/extractors/thrift-patterns/java.d.ts +2 -0
  80. package/dist/core/group/extractors/thrift-patterns/java.js +220 -0
  81. package/dist/core/group/extractors/thrift-patterns/types.d.ts +17 -0
  82. package/dist/core/group/extractors/thrift-patterns/types.js +1 -0
  83. package/dist/core/group/extractors/topic-extractor.js +14 -14
  84. package/dist/core/group/extractors/workspace-extractor.d.ts +13 -0
  85. package/dist/core/group/extractors/workspace-extractor.js +65 -0
  86. package/dist/core/group/matching.d.ts +3 -3
  87. package/dist/core/group/matching.js +136 -50
  88. package/dist/core/group/service.d.ts +1 -0
  89. package/dist/core/group/service.js +5 -4
  90. package/dist/core/group/storage.js +70 -4
  91. package/dist/core/group/sync.js +85 -14
  92. package/dist/core/group/types.d.ts +22 -1
  93. package/dist/core/ingestion/ast-cache.js +2 -1
  94. package/dist/core/ingestion/call-processor.d.ts +3 -3
  95. package/dist/core/ingestion/call-processor.js +59 -65
  96. package/dist/core/ingestion/cluster-enricher.js +3 -2
  97. package/dist/core/ingestion/cobol/cobol-copy-expander.js +4 -20
  98. package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +2 -0
  99. package/dist/core/ingestion/cobol/cobol-preprocessor.js +14 -2
  100. package/dist/core/ingestion/entry-point-scoring.d.ts +0 -18
  101. package/dist/core/ingestion/entry-point-scoring.js +7 -188
  102. package/dist/core/ingestion/field-extractors/configs/csharp.js +8 -3
  103. package/dist/core/ingestion/filesystem-walker.js +3 -2
  104. package/dist/core/ingestion/framework-detection.d.ts +0 -120
  105. package/dist/core/ingestion/framework-detection.js +7 -365
  106. package/dist/core/ingestion/heritage-processor.js +3 -2
  107. package/dist/core/ingestion/import-processor.js +14 -12
  108. package/dist/core/ingestion/language-config.js +6 -5
  109. package/dist/core/ingestion/language-provider.d.ts +23 -0
  110. package/dist/core/ingestion/languages/c-cpp.js +70 -0
  111. package/dist/core/ingestion/languages/cobol.js +2 -0
  112. package/dist/core/ingestion/languages/csharp/captures.js +93 -0
  113. package/dist/core/ingestion/languages/csharp/query.js +6 -0
  114. package/dist/core/ingestion/languages/csharp.js +49 -0
  115. package/dist/core/ingestion/languages/dart.js +36 -0
  116. package/dist/core/ingestion/languages/go/arity-metadata.d.ts +8 -0
  117. package/dist/core/ingestion/languages/go/arity-metadata.js +37 -0
  118. package/dist/core/ingestion/languages/go/arity.d.ts +2 -0
  119. package/dist/core/ingestion/languages/go/arity.js +14 -0
  120. package/dist/core/ingestion/languages/go/cache-stats.d.ts +7 -0
  121. package/dist/core/ingestion/languages/go/cache-stats.js +15 -0
  122. package/dist/core/ingestion/languages/go/captures.d.ts +2 -0
  123. package/dist/core/ingestion/languages/go/captures.js +128 -0
  124. package/dist/core/ingestion/languages/go/expand-wildcards.d.ts +15 -0
  125. package/dist/core/ingestion/languages/go/expand-wildcards.js +93 -0
  126. package/dist/core/ingestion/languages/go/import-decomposer.d.ts +3 -0
  127. package/dist/core/ingestion/languages/go/import-decomposer.js +44 -0
  128. package/dist/core/ingestion/languages/go/import-target.d.ts +21 -0
  129. package/dist/core/ingestion/languages/go/import-target.js +67 -0
  130. package/dist/core/ingestion/languages/go/index.d.ts +17 -0
  131. package/dist/core/ingestion/languages/go/index.js +17 -0
  132. package/dist/core/ingestion/languages/go/interface-impls.d.ts +4 -0
  133. package/dist/core/ingestion/languages/go/interface-impls.js +72 -0
  134. package/dist/core/ingestion/languages/go/interpret.d.ts +11 -0
  135. package/dist/core/ingestion/languages/go/interpret.js +146 -0
  136. package/dist/core/ingestion/languages/go/merge-bindings.d.ts +2 -0
  137. package/dist/core/ingestion/languages/go/merge-bindings.js +18 -0
  138. package/dist/core/ingestion/languages/go/method-owners.d.ts +17 -0
  139. package/dist/core/ingestion/languages/go/method-owners.js +96 -0
  140. package/dist/core/ingestion/languages/go/namespace-mirror.d.ts +15 -0
  141. package/dist/core/ingestion/languages/go/namespace-mirror.js +53 -0
  142. package/dist/core/ingestion/languages/go/package-siblings.d.ts +11 -0
  143. package/dist/core/ingestion/languages/go/package-siblings.js +84 -0
  144. package/dist/core/ingestion/languages/go/query.d.ts +3 -0
  145. package/dist/core/ingestion/languages/go/query.js +207 -0
  146. package/dist/core/ingestion/languages/go/range-binding.d.ts +8 -0
  147. package/dist/core/ingestion/languages/go/range-binding.js +108 -0
  148. package/dist/core/ingestion/languages/go/receiver-binding.d.ts +3 -0
  149. package/dist/core/ingestion/languages/go/receiver-binding.js +21 -0
  150. package/dist/core/ingestion/languages/go/scope-resolver.d.ts +2 -0
  151. package/dist/core/ingestion/languages/go/scope-resolver.js +33 -0
  152. package/dist/core/ingestion/languages/go/simple-hooks.d.ts +4 -0
  153. package/dist/core/ingestion/languages/go/simple-hooks.js +21 -0
  154. package/dist/core/ingestion/languages/go/type-binding.d.ts +3 -0
  155. package/dist/core/ingestion/languages/go/type-binding.js +237 -0
  156. package/dist/core/ingestion/languages/go.js +50 -0
  157. package/dist/core/ingestion/languages/java.js +21 -0
  158. package/dist/core/ingestion/languages/kotlin.js +41 -0
  159. package/dist/core/ingestion/languages/php.js +35 -0
  160. package/dist/core/ingestion/languages/python/captures.js +19 -4
  161. package/dist/core/ingestion/languages/python/import-target.js +121 -25
  162. package/dist/core/ingestion/languages/python.js +41 -0
  163. package/dist/core/ingestion/languages/ruby.js +25 -0
  164. package/dist/core/ingestion/languages/rust.js +35 -0
  165. package/dist/core/ingestion/languages/swift.js +68 -0
  166. package/dist/core/ingestion/languages/typescript/captures.js +22 -0
  167. package/dist/core/ingestion/languages/typescript/query.d.ts +7 -0
  168. package/dist/core/ingestion/languages/typescript/query.js +205 -5
  169. package/dist/core/ingestion/languages/typescript.js +132 -11
  170. package/dist/core/ingestion/languages/vue.js +2 -0
  171. package/dist/core/ingestion/method-extractors/configs/swift.js +3 -4
  172. package/dist/core/ingestion/method-extractors/generic.js +2 -1
  173. package/dist/core/ingestion/model/resolve.js +31 -11
  174. package/dist/core/ingestion/parsing-processor.js +23 -11
  175. package/dist/core/ingestion/pipeline-phases/cobol.js +4 -3
  176. package/dist/core/ingestion/pipeline-phases/communities.js +2 -1
  177. package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +5 -4
  178. package/dist/core/ingestion/pipeline-phases/cross-file.js +3 -2
  179. package/dist/core/ingestion/pipeline-phases/markdown.js +2 -1
  180. package/dist/core/ingestion/pipeline-phases/mro.js +2 -1
  181. package/dist/core/ingestion/pipeline-phases/orm.js +2 -1
  182. package/dist/core/ingestion/pipeline-phases/parse-impl.js +9 -8
  183. package/dist/core/ingestion/pipeline-phases/processes.js +12 -6
  184. package/dist/core/ingestion/pipeline-phases/routes.js +4 -3
  185. package/dist/core/ingestion/pipeline-phases/runner.js +3 -2
  186. package/dist/core/ingestion/pipeline-phases/tools.d.ts +1 -0
  187. package/dist/core/ingestion/pipeline-phases/tools.js +12 -5
  188. package/dist/core/ingestion/process-processor.js +4 -3
  189. package/dist/core/ingestion/registry-primary-flag.js +1 -0
  190. package/dist/core/ingestion/scope-extractor-bridge.js +2 -2
  191. package/dist/core/ingestion/scope-extractor.js +18 -5
  192. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +60 -1
  193. package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +33 -3
  194. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +3 -1
  195. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +49 -1
  196. package/dist/core/ingestion/scope-resolution/passes/imported-return-types.d.ts +7 -1
  197. package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +1 -1
  198. package/dist/core/ingestion/scope-resolution/passes/mro.js +2 -1
  199. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +48 -25
  200. package/dist/core/ingestion/scope-resolution/pipeline/phase.js +3 -2
  201. package/dist/core/ingestion/scope-resolution/pipeline/registry.js +2 -0
  202. package/dist/core/ingestion/scope-resolution/pipeline/run.js +27 -6
  203. package/dist/core/ingestion/scope-resolution/scope/namespace-targets.d.ts +1 -1
  204. package/dist/core/ingestion/scope-resolution/scope/namespace-targets.js +7 -1
  205. package/dist/core/ingestion/scope-resolution/scope/walkers.js +23 -0
  206. package/dist/core/ingestion/tree-sitter-queries.d.ts +2 -2
  207. package/dist/core/ingestion/tree-sitter-queries.js +149 -0
  208. package/dist/core/ingestion/type-env.js +2 -1
  209. package/dist/core/ingestion/type-extractors/swift.js +7 -4
  210. package/dist/core/ingestion/utils/ast-helpers.d.ts +12 -1
  211. package/dist/core/ingestion/utils/ast-helpers.js +15 -1
  212. package/dist/core/ingestion/utils/max-file-size.js +2 -1
  213. package/dist/core/ingestion/vue-sfc-extractor.js +18 -1
  214. package/dist/core/ingestion/workers/parse-worker.d.ts +1 -0
  215. package/dist/core/ingestion/workers/parse-worker.js +17 -10
  216. package/dist/core/ingestion/workers/worker-pool.d.ts +11 -4
  217. package/dist/core/ingestion/workers/worker-pool.js +303 -49
  218. package/dist/core/lbug/csv-generator.js +5 -1
  219. package/dist/core/lbug/extension-loader.d.ts +86 -0
  220. package/dist/core/lbug/extension-loader.js +186 -0
  221. package/dist/core/lbug/lbug-adapter.d.ts +54 -17
  222. package/dist/core/lbug/lbug-adapter.js +202 -158
  223. package/dist/core/lbug/lbug-config.d.ts +102 -0
  224. package/dist/core/lbug/lbug-config.js +303 -0
  225. package/dist/core/lbug/pool-adapter.d.ts +1 -4
  226. package/dist/core/lbug/pool-adapter.js +82 -39
  227. package/dist/core/lbug/schema.d.ts +1 -1
  228. package/dist/core/lbug/schema.js +12 -1
  229. package/dist/core/logger.d.ts +125 -0
  230. package/dist/core/logger.js +323 -0
  231. package/dist/core/platform/capabilities.d.ts +24 -0
  232. package/dist/core/platform/capabilities.js +54 -0
  233. package/dist/core/run-analyze.d.ts +8 -1
  234. package/dist/core/run-analyze.js +71 -16
  235. package/dist/core/search/bm25-index.d.ts +6 -1
  236. package/dist/core/search/bm25-index.js +27 -10
  237. package/dist/core/search/hybrid-search.d.ts +4 -3
  238. package/dist/core/search/hybrid-search.js +6 -5
  239. package/dist/core/tree-sitter/parser-loader.d.ts +2 -2
  240. package/dist/core/tree-sitter/parser-loader.js +173 -68
  241. package/dist/core/wiki/cursor-client.js +2 -1
  242. package/dist/core/wiki/llm-client.js +6 -11
  243. package/dist/mcp/compatible-stdio-transport.js +7 -1
  244. package/dist/mcp/core/embedder.js +37 -16
  245. package/dist/mcp/core/lbug-adapter.d.ts +7 -1
  246. package/dist/mcp/core/lbug-adapter.js +7 -1
  247. package/dist/mcp/local/local-backend.d.ts +9 -0
  248. package/dist/mcp/local/local-backend.js +199 -45
  249. package/dist/mcp/server.js +26 -8
  250. package/dist/mcp/stdio-capture.d.ts +40 -0
  251. package/dist/mcp/stdio-capture.js +53 -0
  252. package/dist/mcp/stdio-context.d.ts +47 -0
  253. package/dist/mcp/stdio-context.js +145 -0
  254. package/dist/mcp/tools.d.ts +2 -0
  255. package/dist/mcp/tools.js +33 -0
  256. package/dist/server/api.d.ts +25 -0
  257. package/dist/server/api.js +323 -79
  258. package/dist/server/git-clone.d.ts +75 -2
  259. package/dist/server/git-clone.js +229 -13
  260. package/dist/server/mcp-http.js +2 -1
  261. package/dist/server/validation.d.ts +98 -0
  262. package/dist/server/validation.js +142 -0
  263. package/dist/storage/git.d.ts +57 -0
  264. package/dist/storage/git.js +124 -2
  265. package/dist/storage/repo-manager.d.ts +40 -2
  266. package/dist/storage/repo-manager.js +121 -13
  267. package/hooks/claude/gitnexus-hook.cjs +62 -3
  268. package/package.json +14 -10
  269. package/scripts/build-tree-sitter-dart.cjs +53 -0
  270. package/scripts/build-tree-sitter-proto.cjs +12 -1
  271. package/scripts/build.js +22 -2
  272. package/scripts/install-duckdb-extension.mjs +48 -0
  273. package/vendor/tree-sitter-dart/README.md +18 -0
  274. package/vendor/tree-sitter-dart/binding.gyp +31 -0
  275. package/vendor/tree-sitter-dart/bindings/node/binding.cc +20 -0
  276. package/vendor/tree-sitter-dart/bindings/node/index.d.ts +28 -0
  277. package/vendor/tree-sitter-dart/bindings/node/index.js +7 -0
  278. package/vendor/tree-sitter-dart/grammar.js +2895 -0
  279. package/vendor/tree-sitter-dart/package.json +18 -0
  280. package/vendor/tree-sitter-dart/queries/highlights.scm +246 -0
  281. package/vendor/tree-sitter-dart/queries/tags.scm +92 -0
  282. package/vendor/tree-sitter-dart/queries/test.scm +1 -0
  283. package/vendor/tree-sitter-dart/src/grammar.json +12459 -0
  284. package/vendor/tree-sitter-dart/src/node-types.json +15055 -0
  285. package/vendor/tree-sitter-dart/src/parser.c +196127 -0
  286. package/vendor/tree-sitter-dart/src/scanner.c +130 -0
  287. package/vendor/tree-sitter-dart/src/tree_sitter/alloc.h +54 -0
  288. package/vendor/tree-sitter-dart/src/tree_sitter/array.h +290 -0
  289. package/vendor/tree-sitter-dart/src/tree_sitter/parser.h +265 -0
  290. package/vendor/tree-sitter-swift/LICENSE +21 -0
  291. package/vendor/tree-sitter-swift/README.md +139 -0
  292. package/vendor/tree-sitter-swift/bindings/node/index.d.ts +28 -0
  293. package/vendor/tree-sitter-swift/bindings/node/index.js +7 -0
  294. package/vendor/tree-sitter-swift/package.json +28 -0
  295. package/vendor/tree-sitter-swift/prebuilds/darwin-arm64/tree-sitter-swift.node +0 -0
  296. package/vendor/tree-sitter-swift/prebuilds/darwin-x64/tree-sitter-swift.node +0 -0
  297. package/vendor/tree-sitter-swift/prebuilds/linux-arm64/tree-sitter-swift.node +0 -0
  298. package/vendor/tree-sitter-swift/prebuilds/linux-x64/tree-sitter-swift.node +0 -0
  299. package/vendor/tree-sitter-swift/prebuilds/win32-arm64/tree-sitter-swift.node +0 -0
  300. package/vendor/tree-sitter-swift/prebuilds/win32-x64/tree-sitter-swift.node +0 -0
  301. package/vendor/tree-sitter-swift/src/node-types.json +30694 -0
  302. package/web/assets/agent-Dl2d-mDi.js +597 -0
  303. package/web/assets/architecture-YZFGNWBL-S5CXDPWN-BYXnTu07.js +1 -0
  304. package/web/assets/architectureDiagram-EMZXCZ2Q-uiiIna83.js +36 -0
  305. package/web/assets/blockDiagram-IGV67L2C-uBKdDzXA.js +132 -0
  306. package/web/assets/c4Diagram-DFAF54RM-DTxaX43T.js +10 -0
  307. package/web/assets/chunk-3GS5O3IE-BxKKu7d7.js +231 -0
  308. package/web/assets/chunk-3YCYZ6SJ-BJZnGFjg.js +1 -0
  309. package/web/assets/chunk-6NTNNK5N-CIL_eO2d.js +1 -0
  310. package/web/assets/chunk-7RZVMHOQ-BdIU-RGO.js +321 -0
  311. package/web/assets/chunk-A34GCYZU-Dv4Vkem9.js +1 -0
  312. package/web/assets/chunk-AEOMTBSW-D7qjBMHW.js +1 -0
  313. package/web/assets/chunk-CilyBKbf.js +1 -0
  314. package/web/assets/chunk-DJ7UZH7F-Cskl-nb3.js +1 -0
  315. package/web/assets/chunk-DKKBVRCY-D3S2BD56.js +4 -0
  316. package/web/assets/chunk-DU5LTGQ6-B8Zh51LG.js +1 -0
  317. package/web/assets/chunk-FXACKDTF-Cb4xHVUz.js +159 -0
  318. package/web/assets/chunk-H3VCZNTA-BOGhqvxW.js +1 -0
  319. package/web/assets/chunk-HN6EAY2L-CitKFy1e.js +1 -0
  320. package/web/assets/chunk-KSICW3F5-C2tZmXwv.js +15 -0
  321. package/web/assets/chunk-O5ABG6QK-V3sk7Bps.js +1 -0
  322. package/web/assets/chunk-PK6DOVAG-FvG7aKfZ.js +206 -0
  323. package/web/assets/chunk-RNJOYNJ4-BPANsy8V.js +1 -0
  324. package/web/assets/chunk-RWUO3TPN-BHusg2jI.js +1 -0
  325. package/web/assets/chunk-TBF5ZNIQ-CXamrpH3.js +1 -0
  326. package/web/assets/chunk-TU3PZOEN-DE5Qhc0N.js +1 -0
  327. package/web/assets/chunk-TYMNRAUI-BnMe6HfP.js +1 -0
  328. package/web/assets/chunk-VELTKBKT-C9dVN39o.js +1 -0
  329. package/web/assets/chunk-W7ZLLLMY-BqZFKM5j.js +1 -0
  330. package/web/assets/chunk-WSB5WSVC-EKS7-Nnc.js +1 -0
  331. package/web/assets/chunk-XGPFEOL4-BBab-enK.js +1 -0
  332. package/web/assets/classDiagram-PPOCWD7C-B-LkKU0P.js +1 -0
  333. package/web/assets/classDiagram-v2-23LJLIIU-_NGI4VEh.js +1 -0
  334. package/web/assets/context-builder-CqQNhRj1.js +15 -0
  335. package/web/assets/cose-bilkent-PNC4W37J-DjEQkTZ4.js +1 -0
  336. package/web/assets/dagre-E77IOHMT-D6Xacg1x.js +4 -0
  337. package/web/assets/diagram-H7BISOXX-CMuISoJL.js +43 -0
  338. package/web/assets/diagram-JC5VWROH-DHq_eoeM.js +24 -0
  339. package/web/assets/diagram-LXUTUG65-C0NczIgW.js +10 -0
  340. package/web/assets/diagram-WEHSV5V5-WsBnpSuc.js +24 -0
  341. package/web/assets/erDiagram-GCSMX5X6-DxHFHFR6.js +85 -0
  342. package/web/assets/flowDiagram-OTCZ4VVT-_G1VxyQS.js +162 -0
  343. package/web/assets/ganttDiagram-MUNLMDZQ-BIHObj0t.js +292 -0
  344. package/web/assets/gitGraph-7Q5UKJZL-54BCDZD5-BXJXsixL.js +1 -0
  345. package/web/assets/gitGraphDiagram-3HKGZ4G3-COZUkHTD.js +106 -0
  346. package/web/assets/index-BleGLU8S.css +2 -0
  347. package/web/assets/index-DDcYO1IJ.js +886 -0
  348. package/web/assets/info-OMHHGYJF-BF2H5H6G-C820LK0J.js +1 -0
  349. package/web/assets/infoDiagram-MN7RKWGX-BeOjfPc_.js +2 -0
  350. package/web/assets/ishikawaDiagram-YMYX4NHK-C-JI2Ih7.js +70 -0
  351. package/web/assets/journeyDiagram-SO5T7YLQ-IPX4h3iD.js +139 -0
  352. package/web/assets/kanban-definition-LJHFXRCJ-B23LtshQ.js +89 -0
  353. package/web/assets/katex-GD7MH7QM-CJiOjBBJ.js +261 -0
  354. package/web/assets/mindmap-definition-2EUWGEK5-DJKUsrCo.js +96 -0
  355. package/web/assets/packet-4T2RLAQJ-EV4IVRXR-BvWtM5jq.js +1 -0
  356. package/web/assets/pie-ZZUOXDRM-N23DN5KN-BnDgj0TQ.js +1 -0
  357. package/web/assets/pieDiagram-3IATQBI2-Bj26KTKk.js +30 -0
  358. package/web/assets/quadrantDiagram-E256RVCF-VAk5oIRr.js +7 -0
  359. package/web/assets/radar-PYXPWWZC-P6TP7ZYP-2IuDlZ6r.js +1 -0
  360. package/web/assets/requirementDiagram-M5DCFWZL-CmlTJ_vQ.js +84 -0
  361. package/web/assets/sankeyDiagram-L3NBLAOT-C-f_DdcX.js +10 -0
  362. package/web/assets/sequenceDiagram-ZOUHS735-DmtNf1NF.js +157 -0
  363. package/web/assets/stateDiagram-MLPALWAM-Lq7UVrkj.js +1 -0
  364. package/web/assets/stateDiagram-v2-B5LQ5ZB2-DCiXBPeS.js +1 -0
  365. package/web/assets/timeline-definition-5SPVSISX-BkpqZxt2.js +120 -0
  366. package/web/assets/treeView-SZITEDCU-5DXDK3XO-Ipq1EIaF.js +1 -0
  367. package/web/assets/treemap-W4RFUUIX-WYLRDWKO-DESFxovu.js +1 -0
  368. package/web/assets/vennDiagram-IE5QUKF5-iAJ08JBe.js +34 -0
  369. package/web/assets/wardley-RL74JXVD-BCRCBASE-BVkhckBY.js +1 -0
  370. package/web/assets/wardleyDiagram-XU3VSMPF-BDiKTkL4.js +20 -0
  371. package/web/assets/xychartDiagram-ZHJ5623Y-CknyZyQK.js +7 -0
  372. package/web/index.html +21 -0
  373. package/scripts/patch-tree-sitter-swift.cjs +0 -78
package/README.md CHANGED
@@ -156,6 +156,7 @@ gitnexus analyze --embeddings # Enable embedding generation (slower, better s
156
156
  gitnexus analyze --skip-agents-md # Preserve custom AGENTS.md/CLAUDE.md gitnexus section edits
157
157
  gitnexus analyze --verbose # Log skipped files when parsers are unavailable
158
158
  gitnexus analyze --max-file-size 1024 # Skip files larger than N KB (default: 512, cap: 32768)
159
+ gitnexus analyze --worker-timeout 60 # Increase worker idle timeout for slow parses
159
160
  gitnexus mcp # Start MCP server (stdio) — serves all indexed repos
160
161
  gitnexus serve # Start local HTTP server (multi-repo) for web UI
161
162
  gitnexus index # Register an existing .gitnexus/ folder into the global registry
@@ -295,6 +296,25 @@ If `npm install -g gitnexus` fails on native modules:
295
296
  npm install -g gitnexus
296
297
  ```
297
298
 
299
+ ### Analyze warns about unavailable FTS or VECTOR extensions
300
+
301
+ GitNexus uses optional DuckDB extensions for BM25 and vector search. The `gitnexus serve` and MCP read paths only ever try to `LOAD` the extensions — they never block on a network install. The `analyze` command, by default, attempts one bounded out-of-process `INSTALL` if `LOAD` fails and proceeds even when that install times out, so the index is always written to disk; BM25/vector search degrade gracefully until the extensions become available.
302
+
303
+ Configure the behavior with two environment variables:
304
+
305
+ | Variable | Values | Default | Effect |
306
+ |----------|--------|---------|--------|
307
+ | `GITNEXUS_LBUG_EXTENSION_INSTALL` | `auto`, `load-only`, `never` | `auto` | `auto` runs one bounded INSTALL if LOAD fails. `load-only` only uses already-installed extensions (recommended for offline / firewalled environments). `never` skips optional extensions entirely. |
308
+ | `GITNEXUS_LBUG_EXTENSION_INSTALL_TIMEOUT_MS` | positive integer | `15000` | Wall-clock budget for the out-of-process `INSTALL` child before it is killed. |
309
+
310
+ ```bash
311
+ # Offline/airgapped: never reach the network for extensions
312
+ GITNEXUS_LBUG_EXTENSION_INSTALL=load-only npx gitnexus analyze
313
+
314
+ # Slow network: give extension downloads more time
315
+ GITNEXUS_LBUG_EXTENSION_INSTALL_TIMEOUT_MS=30000 npx gitnexus analyze
316
+ ```
317
+
298
318
  ### Analysis runs out of memory
299
319
 
300
320
  For very large repositories:
@@ -323,6 +343,21 @@ npx gitnexus analyze
323
343
 
324
344
  Values above **32768 KB (32 MB)** are clamped to the tree-sitter parser ceiling; invalid values fall back to the 512 KB default with a one-time warning. When an override is active, `analyze` prints the effective threshold in its startup banner (e.g. `GITNEXUS_MAX_FILE_SIZE: effective threshold 2048KB (default 512KB)`).
325
345
 
346
+ ### Analyze reports a worker timeout
347
+
348
+ Worker parse timeouts are recoverable. GitNexus retries stalled worker jobs with backoff, splits large jobs to isolate slow files, and falls back to the sequential parser when needed. If a large repository needs more time per worker job, use either:
349
+
350
+ ```bash
351
+ # CLI flag, in seconds
352
+ npx gitnexus analyze --worker-timeout 60
353
+
354
+ # Environment variable, in milliseconds
355
+ export GITNEXUS_WORKER_SUB_BATCH_TIMEOUT_MS=60000
356
+ npx gitnexus analyze
357
+ ```
358
+
359
+ For repositories with very large source files, `GITNEXUS_WORKER_SUB_BATCH_MAX_BYTES` controls the worker job byte budget. The default is **8388608 bytes (8 MB)**.
360
+
326
361
  ## Privacy
327
362
 
328
363
  - All processing happens locally on your machine
@@ -48,6 +48,8 @@ export { buildScopeTree, canParentScope, ScopeTreeInvariantError, } from './scop
48
48
  export type { ScopeTree } from './scope-resolution/scope-tree.js';
49
49
  export { buildPositionIndex } from './scope-resolution/position-index.js';
50
50
  export type { PositionIndex } from './scope-resolution/position-index.js';
51
+ export { UNDERSTAND_QUICKLY_DISPATCH_URL, UNDERSTAND_QUICKLY_EVENT_TYPE, UNDERSTAND_QUICKLY_TOKEN_ENV, buildUqDispatchPayload, isValidOwnerRepo, parseOwnerRepoFromRemote, stripGitSuffix, } from './integrations/understand-quickly.js';
52
+ export type { UqDispatchPayload } from './integrations/understand-quickly.js';
51
53
  export { diffResolutions } from './scope-resolution/shadow/diff.js';
52
54
  export type { ShadowAgreement, ShadowCallsite, ShadowDiff, } from './scope-resolution/shadow/diff.js';
53
55
  export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,cAAc,EACd,gB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MAAM,6CAA6C,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAClG,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,GACb,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACrF,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EACL,cAAc,EACd,cAAc,EACd,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAG1E,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAG9E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,YAAY,EACV,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC"}
@@ -33,6 +33,8 @@ export { CLASS_KINDS, METHOD_KINDS, FIELD_KINDS } from './scope-resolution/regis
33
33
  export { makeScopeId, clearScopeIdInternPool } from './scope-resolution/scope-id.js';
34
34
  export { buildScopeTree, canParentScope, ScopeTreeInvariantError, } from './scope-resolution/scope-tree.js';
35
35
  export { buildPositionIndex } from './scope-resolution/position-index.js';
36
+ // Understand-Quickly registry integration (opt-in)
37
+ export { UNDERSTAND_QUICKLY_DISPATCH_URL, UNDERSTAND_QUICKLY_EVENT_TYPE, UNDERSTAND_QUICKLY_TOKEN_ENV, buildUqDispatchPayload, isValidOwnerRepo, parseOwnerRepoFromRemote, stripGitSuffix, } from './integrations/understand-quickly.js';
36
38
  // Shadow-mode diff + aggregation (RFC §6.3; Ring 2 SHARED #918)
37
39
  export { diffResolutions } from './scope-resolution/shadow/diff.js';
38
40
  export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,mBAAmB;AACnB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,mBAAmB;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAiCjG,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,yDAAyD;AACzD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AAGvD,sEAAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAGrF,gEAAgE;AAChE,yEAAyE;AACzE,2DAA2D;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAOxE,oFAAoF;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAMvF,uEAAuE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AAM,sCAAsC,CAAC;AAG1E,mDAAmD;AACnD,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,sCAAsC,CAAC;AAG9C,gEAAgE;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAMpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Understand-Quickly registry integration helpers.
3
+ *
4
+ * Pure, runtime-agnostic logic for opting in to publishing a GitNexus
5
+ * index to the [`looptech-ai/understand-quickly`](https://github.com/looptech-ai/understand-quickly)
6
+ * registry. Lives in `gitnexus-shared` so both the Node CLI and any
7
+ * future browser-side surface can construct identical dispatch payloads.
8
+ *
9
+ * Network I/O lives in the CLI command (`gitnexus/src/cli/publish.ts`)
10
+ * to keep this module free of Node-only imports — see the comment at
11
+ * the top of `gitnexus-shared/src/graph/types.ts`.
12
+ *
13
+ * The protocol contract (single dispatch event, no graph upload) is
14
+ * documented at:
15
+ * https://github.com/looptech-ai/understand-quickly/blob/main/docs/integrations/protocol.md
16
+ */
17
+ /**
18
+ * URL of the registry repo's repository_dispatch endpoint. Hardcoded
19
+ * because the registry is the canonical home for this integration —
20
+ * users who want a private registry can fork and patch.
21
+ */
22
+ export declare const UNDERSTAND_QUICKLY_DISPATCH_URL = "https://api.github.com/repos/looptech-ai/understand-quickly/dispatches";
23
+ /**
24
+ * Event type the registry's sync workflow listens for.
25
+ * See `looptech-ai/understand-quickly/.github/workflows/sync.yml`.
26
+ */
27
+ export declare const UNDERSTAND_QUICKLY_EVENT_TYPE = "sync-entry";
28
+ /** Environment variable that gates the dispatch. */
29
+ export declare const UNDERSTAND_QUICKLY_TOKEN_ENV = "UNDERSTAND_QUICKLY_TOKEN";
30
+ export interface UqDispatchPayload {
31
+ event_type: typeof UNDERSTAND_QUICKLY_EVENT_TYPE;
32
+ client_payload: {
33
+ /** `<owner>/<repo>` shape — must match the registered entry. */
34
+ id: string;
35
+ };
36
+ }
37
+ /**
38
+ * Build the JSON body for the `repository_dispatch` ping. Pure — no
39
+ * env reads, no network. Validates that `id` looks like `owner/repo`
40
+ * (one slash, no whitespace, both halves non-empty) so a misconfigured
41
+ * caller fails loudly before the round-trip.
42
+ */
43
+ export declare function buildUqDispatchPayload(id: string): UqDispatchPayload;
44
+ /**
45
+ * `owner/repo` validation. Conservative on purpose: GitHub's actual
46
+ * naming rules are looser, but we want to catch local paths
47
+ * (`/Users/...`), bare slugs (`my-repo`), and accidental whitespace.
48
+ *
49
+ * Matches GitHub's published slug rules:
50
+ * owner: starts with alnum, then alnum/hyphen only, must end with
51
+ * alnum (no trailing hyphen — GitHub rejects this at account
52
+ * creation, so a `my-org-/repo` input would otherwise pass us
53
+ * and 422 from GitHub). No underscore, no dot. Length cap 39.
54
+ * repo: any of alnum/dot/hyphen/underscore. Length cap 100.
55
+ */
56
+ export declare function isValidOwnerRepo(id: string): boolean;
57
+ /**
58
+ * Strip a single trailing `.git` (case-insensitive) and any trailing
59
+ * slashes from a URL-ish string. Bounded linear: each character is
60
+ * visited at most twice, no backtracking.
61
+ *
62
+ * Replaces `s.replace(/\.git\/*$/i, '').replace(/\/+$/, '')` which
63
+ * CodeQL's polynomial-regex check (codeql/js/polynomial-redos) flags as
64
+ * a worst-case O(n²) on adversarial input like "////.../x".
65
+ */
66
+ export declare function stripGitSuffix(input: string): string;
67
+ /**
68
+ * Parse `owner/repo` out of a git remote URL. Mirrors the heuristic in
69
+ * `gitnexus/src/storage/git.ts:parseRepoNameFromUrl` but keeps both
70
+ * halves so we can build a registry id. Returns `null` on shapes we
71
+ * don't recognise.
72
+ *
73
+ * Examples:
74
+ * git@github.com:looptech-ai/understand-quickly.git
75
+ * https://github.com/looptech-ai/understand-quickly
76
+ * ssh://git@github.com/looptech-ai/understand-quickly.git
77
+ */
78
+ export declare function parseOwnerRepoFromRemote(url: string | null | undefined): string | null;
79
+ //# sourceMappingURL=understand-quickly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"understand-quickly.d.ts","sourceRoot":"","sources":["../../src/integrations/understand-quickly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,2EAC8B,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAE1D,oDAAoD;AACpD,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,OAAO,6BAA6B,CAAC;IACjD,cAAc,EAAE;QACd,gEAAgE;QAChE,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAYpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAsCtF"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Understand-Quickly registry integration helpers.
3
+ *
4
+ * Pure, runtime-agnostic logic for opting in to publishing a GitNexus
5
+ * index to the [`looptech-ai/understand-quickly`](https://github.com/looptech-ai/understand-quickly)
6
+ * registry. Lives in `gitnexus-shared` so both the Node CLI and any
7
+ * future browser-side surface can construct identical dispatch payloads.
8
+ *
9
+ * Network I/O lives in the CLI command (`gitnexus/src/cli/publish.ts`)
10
+ * to keep this module free of Node-only imports — see the comment at
11
+ * the top of `gitnexus-shared/src/graph/types.ts`.
12
+ *
13
+ * The protocol contract (single dispatch event, no graph upload) is
14
+ * documented at:
15
+ * https://github.com/looptech-ai/understand-quickly/blob/main/docs/integrations/protocol.md
16
+ */
17
+ /**
18
+ * URL of the registry repo's repository_dispatch endpoint. Hardcoded
19
+ * because the registry is the canonical home for this integration —
20
+ * users who want a private registry can fork and patch.
21
+ */
22
+ export const UNDERSTAND_QUICKLY_DISPATCH_URL = 'https://api.github.com/repos/looptech-ai/understand-quickly/dispatches';
23
+ /**
24
+ * Event type the registry's sync workflow listens for.
25
+ * See `looptech-ai/understand-quickly/.github/workflows/sync.yml`.
26
+ */
27
+ export const UNDERSTAND_QUICKLY_EVENT_TYPE = 'sync-entry';
28
+ /** Environment variable that gates the dispatch. */
29
+ export const UNDERSTAND_QUICKLY_TOKEN_ENV = 'UNDERSTAND_QUICKLY_TOKEN';
30
+ /**
31
+ * Build the JSON body for the `repository_dispatch` ping. Pure — no
32
+ * env reads, no network. Validates that `id` looks like `owner/repo`
33
+ * (one slash, no whitespace, both halves non-empty) so a misconfigured
34
+ * caller fails loudly before the round-trip.
35
+ */
36
+ export function buildUqDispatchPayload(id) {
37
+ if (!isValidOwnerRepo(id)) {
38
+ throw new Error(`[understand-quickly] expected id of the form "owner/repo", got "${id}". ` +
39
+ `The registry uses this string to look up your entry in registry.json — ` +
40
+ `it must match the GitHub owner/repo of the source code, not a local path.`);
41
+ }
42
+ return {
43
+ event_type: UNDERSTAND_QUICKLY_EVENT_TYPE,
44
+ client_payload: { id },
45
+ };
46
+ }
47
+ /**
48
+ * `owner/repo` validation. Conservative on purpose: GitHub's actual
49
+ * naming rules are looser, but we want to catch local paths
50
+ * (`/Users/...`), bare slugs (`my-repo`), and accidental whitespace.
51
+ *
52
+ * Matches GitHub's published slug rules:
53
+ * owner: starts with alnum, then alnum/hyphen only, must end with
54
+ * alnum (no trailing hyphen — GitHub rejects this at account
55
+ * creation, so a `my-org-/repo` input would otherwise pass us
56
+ * and 422 from GitHub). No underscore, no dot. Length cap 39.
57
+ * repo: any of alnum/dot/hyphen/underscore. Length cap 100.
58
+ */
59
+ export function isValidOwnerRepo(id) {
60
+ return /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/[A-Za-z0-9._-]{1,100}$/.test(id);
61
+ }
62
+ /**
63
+ * Strip a single trailing `.git` (case-insensitive) and any trailing
64
+ * slashes from a URL-ish string. Bounded linear: each character is
65
+ * visited at most twice, no backtracking.
66
+ *
67
+ * Replaces `s.replace(/\.git\/*$/i, '').replace(/\/+$/, '')` which
68
+ * CodeQL's polynomial-regex check (codeql/js/polynomial-redos) flags as
69
+ * a worst-case O(n²) on adversarial input like "////.../x".
70
+ */
71
+ export function stripGitSuffix(input) {
72
+ let end = input.length;
73
+ // Trim trailing '/'.
74
+ while (end > 0 && input.charCodeAt(end - 1) === 0x2f)
75
+ end--;
76
+ // Drop one trailing '.git' (case-insensitive).
77
+ if (end >= 4) {
78
+ const tail = input.slice(end - 4, end).toLowerCase();
79
+ if (tail === '.git')
80
+ end -= 4;
81
+ }
82
+ // Trim trailing '/' that may have sat between '.git' and the rest.
83
+ while (end > 0 && input.charCodeAt(end - 1) === 0x2f)
84
+ end--;
85
+ return input.slice(0, end);
86
+ }
87
+ /**
88
+ * Parse `owner/repo` out of a git remote URL. Mirrors the heuristic in
89
+ * `gitnexus/src/storage/git.ts:parseRepoNameFromUrl` but keeps both
90
+ * halves so we can build a registry id. Returns `null` on shapes we
91
+ * don't recognise.
92
+ *
93
+ * Examples:
94
+ * git@github.com:looptech-ai/understand-quickly.git
95
+ * https://github.com/looptech-ai/understand-quickly
96
+ * ssh://git@github.com/looptech-ai/understand-quickly.git
97
+ */
98
+ export function parseOwnerRepoFromRemote(url) {
99
+ if (!url)
100
+ return null;
101
+ const trimmed = url.trim();
102
+ if (!trimmed)
103
+ return null;
104
+ // Strip a trailing `.git` (case-insensitive) and any trailing slashes
105
+ // so https://h/o/r and https://h/o/r.git collapse to the same id.
106
+ // Bounded-linear helper avoids the polynomial-regex CodeQL alert.
107
+ const stripped = stripGitSuffix(trimmed);
108
+ // SCP-form SSH (`git@host:owner/repo`). Capture host so we can reject
109
+ // non-GitHub remotes — a GitLab origin like
110
+ // `https://gitlab.example.com/group/sub/project.git` would otherwise
111
+ // silently dispatch the wrong id (LOW 9).
112
+ const ssh = stripped.match(/^[^@]+@([^:]+):([^/]+)\/([^/]+)$/);
113
+ if (ssh) {
114
+ const host = ssh[1].toLowerCase();
115
+ if (host !== 'github.com' && host !== 'www.github.com')
116
+ return null;
117
+ return `${ssh[2]}/${ssh[3]}`;
118
+ }
119
+ // URL forms (https://, ssh://, git://, file://) — last two path segments.
120
+ const url2 = stripped.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/([^/]+)\/(.+)$/);
121
+ if (url2) {
122
+ // Strip optional `userinfo@` (e.g. `ssh://git@github.com/...`).
123
+ const authority = url2[1];
124
+ const atIdx = authority.lastIndexOf('@');
125
+ const hostAndPort = atIdx >= 0 ? authority.slice(atIdx + 1) : authority;
126
+ // Strip `:port` suffix if present.
127
+ const colonIdx = hostAndPort.indexOf(':');
128
+ const host = (colonIdx >= 0 ? hostAndPort.slice(0, colonIdx) : hostAndPort).toLowerCase();
129
+ if (host !== 'github.com' && host !== 'www.github.com')
130
+ return null;
131
+ const segments = url2[2].split('/').filter(Boolean);
132
+ if (segments.length >= 2) {
133
+ const [owner, repo] = segments.slice(-2);
134
+ return `${owner}/${repo}`;
135
+ }
136
+ }
137
+ return null;
138
+ }
139
+ //# sourceMappingURL=understand-quickly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"understand-quickly.js","sourceRoot":"","sources":["../../src/integrations/understand-quickly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,wEAAwE,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CAAC;AAE1D,oDAAoD;AACpD,MAAM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AAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1F,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,gBAAgB;YAAE,OAAO,IAAI,CAAC;QACpE,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,OAAO,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -83,7 +83,7 @@ export interface FinalizeHooks {
83
83
  * Return `null` when no target file is resolvable (e.g., `np.foo` when
84
84
  * `numpy` is external to the workspace).
85
85
  */
86
- resolveImportTarget(targetRaw: string, fromFile: string, workspaceIndex: WorkspaceIndex): string | null;
86
+ resolveImportTarget(targetRaw: string, fromFile: string, workspaceIndex: WorkspaceIndex): string | readonly string[] | null;
87
87
  /**
88
88
  * For a wildcard `import * from M`, return the names visible in the
89
89
  * exporting module scope `M`. The finalize pass looks each name up in
@@ -109,20 +109,22 @@ export interface FinalizedScc {
109
109
  /**
110
110
  * Counters reported by `finalize`.
111
111
  *
112
- * **Counting granularity** — all edge counters are **per-`ParsedImport`**,
113
- * not per-materialized-`ImportEdge`. A single `wildcard` ParsedImport that
114
- * expands to N exports counts as one linked edge in these stats; the
115
- * materialized output (`FinalizeOutput.imports`) will have N edges for
116
- * that input. `dynamic-unresolved` ParsedImports count as linked (they
117
- * pass through with no `linkStatus`), so `linkedEdges` ≠ "has a
112
+ * **Counting granularity** — `totalEdges` is **per-generated-`ImportEdgeDraft`**,
113
+ * which may exceed the number of `ParsedImport` records when
114
+ * `resolveImportTarget` returns a multi-file array (e.g. Go package-scoped
115
+ * imports fan out to every `.go` file in the target directory). A single
116
+ * `wildcard` ParsedImport that expands to N exports also counts as one
117
+ * linked edge here; the materialized output (`FinalizeOutput.imports`) will
118
+ * have N edges for that input. `dynamic-unresolved` ParsedImports count as
119
+ * linked (they pass through with no `linkStatus`), so `linkedEdges` ≠ "has a
118
120
  * BindingRef" — use the `bindings` map for that.
119
121
  *
120
- * In other words: `totalEdges === input.parsedImports.length` summed
122
+ * In other words: `totalEdges >= input.parsedImports.length` summed
121
123
  * across files, and `linkedEdges + unresolvedEdges === totalEdges`.
122
124
  */
123
125
  export interface FinalizeStats {
124
126
  readonly totalFiles: number;
125
- /** Total `ParsedImport` records seen across all files. */
127
+ /** Total `ImportEdgeDraft` records generated (≥ ParsedImport count). */
126
128
  readonly totalEdges: number;
127
129
  /**
128
130
  * `ParsedImport`s whose finalized edge does NOT carry
@@ -1 +1 @@
1
- {"version":3,"file":"finalize-algorithm.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/finalize-algorithm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIhG,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;IAChD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACjD;AAED,2BAA2B;AAC3B,MAAM,WAAW,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EAAE,aAAa,CAAC;CAC/B;AAID,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,cAAc,CA8InF"}
@@ -44,9 +44,9 @@ export function finalize(input, hooks) {
44
44
  for (const file of input.files) {
45
45
  const drafts = [];
46
46
  for (const parsed of file.parsedImports) {
47
- const draft = makeEdgeDraft(parsed, file, hooks, input.workspaceIndex);
48
- drafts.push(draft);
49
- totalEdges++;
47
+ const draftArray = makeEdgeDrafts(parsed, file, hooks, input.workspaceIndex);
48
+ drafts.push(...draftArray);
49
+ totalEdges += draftArray.length;
50
50
  }
51
51
  edgeIndex.set(file.filePath, drafts);
52
52
  }
@@ -172,7 +172,7 @@ export function finalize(input, hooks) {
172
172
  stats,
173
173
  });
174
174
  }
175
- function makeEdgeDraft(parsed, file, hooks, workspace) {
175
+ function makeEdgeDrafts(parsed, file, hooks, workspace) {
176
176
  // Dynamic-unresolved passes through — no `BindingRef`, no target file.
177
177
  if (parsed.kind === 'dynamic-unresolved') {
178
178
  const base = {
@@ -181,14 +181,16 @@ function makeEdgeDraft(parsed, file, hooks, workspace) {
181
181
  targetExportedName: '',
182
182
  kind: 'dynamic-unresolved',
183
183
  };
184
- return {
185
- source: parsed,
186
- fromFile: file.filePath,
187
- fromScope: file.moduleScope,
188
- targetFile: null,
189
- base,
190
- finalized: base, // already fully finalized
191
- };
184
+ return [
185
+ {
186
+ source: parsed,
187
+ fromFile: file.filePath,
188
+ fromScope: file.moduleScope,
189
+ targetFile: null,
190
+ base,
191
+ finalized: base, // already fully finalized
192
+ },
193
+ ];
192
194
  }
193
195
  const targetFile = hooks.resolveImportTarget(parsed.targetRaw ?? '', file.filePath, workspace);
194
196
  // Edge is unresolvable at the file level — mark unresolved now.
@@ -200,35 +202,40 @@ function makeEdgeDraft(parsed, file, hooks, workspace) {
200
202
  kind: edgeKindFor(parsed),
201
203
  linkStatus: 'unresolved',
202
204
  };
203
- return {
204
- source: parsed,
205
- fromFile: file.filePath,
206
- fromScope: file.moduleScope,
207
- targetFile: null,
208
- base,
209
- finalized: base,
210
- };
205
+ return [
206
+ {
207
+ source: parsed,
208
+ fromFile: file.filePath,
209
+ fromScope: file.moduleScope,
210
+ targetFile: null,
211
+ base,
212
+ finalized: base,
213
+ },
214
+ ];
211
215
  }
212
216
  // Resolvable at the file level; intra-SCC fixpoint may still fail to fill
213
217
  // in `targetDefId` (e.g., symbol not exported from target). Side-effect
214
218
  // and resolved-dynamic imports are terminal at the file level — no
215
219
  // `targetDefId` needed since they materialize no `BindingRef`. Pre-
216
220
  // finalize them here so the fixpoint loop skips them entirely.
217
- const base = {
218
- localName: extractLocalName(parsed),
219
- targetFile,
220
- targetExportedName: extractExportedName(parsed),
221
- kind: edgeKindFor(parsed),
222
- };
221
+ const targetFiles = Array.isArray(targetFile) ? targetFile : [targetFile];
223
222
  const isFileLevelTerminal = parsed.kind === 'side-effect' || parsed.kind === 'dynamic-resolved';
224
- return {
225
- source: parsed,
226
- fromFile: file.filePath,
227
- fromScope: file.moduleScope,
228
- targetFile,
229
- base,
230
- finalized: isFileLevelTerminal ? base : null,
231
- };
223
+ return targetFiles.map((tf) => {
224
+ const base = {
225
+ localName: extractLocalName(parsed),
226
+ targetFile: tf,
227
+ targetExportedName: extractExportedName(parsed),
228
+ kind: edgeKindFor(parsed),
229
+ };
230
+ return {
231
+ source: parsed,
232
+ fromFile: file.filePath,
233
+ fromScope: file.moduleScope,
234
+ targetFile: tf,
235
+ base,
236
+ finalized: isFileLevelTerminal ? base : null,
237
+ };
238
+ });
232
239
  }
233
240
  function edgeKindFor(parsed) {
234
241
  if (parsed.kind === 'wildcard')
@@ -541,11 +548,59 @@ function deriveSimpleName(def) {
541
548
  return dot === -1 ? q : q.slice(dot + 1);
542
549
  }
543
550
  function findExportByName(defs, name) {
551
+ // GENERIC RULE (applies to every language using this finalize
552
+ // algorithm): when MULTIPLE `SymbolDefinition`s share the same simple
553
+ // name in `localDefs`, prefer callable / type-like defs over plain
554
+ // value defs (`Variable`, `Property`, …). The CALLER side of an
555
+ // import almost always wants the callable, not a value shadow that
556
+ // happens to share the name — and without a deterministic
557
+ // preference, capture order silently decides which def the import
558
+ // binds to.
559
+ //
560
+ // The single-def case is unchanged: when only one def has the name,
561
+ // it's returned regardless of its type (the `fallback` path below).
562
+ //
563
+ // TypeScript is the first known language where this matters in
564
+ // practice: `const fn = () => {}` emits BOTH a `Function` def (from
565
+ // `@declaration.function` on the inner arrow) AND a `Variable` def
566
+ // (from the generic `@declaration.variable` pattern matching the
567
+ // wrapping `lexical_declaration`), and consumers of `import { fn }`
568
+ // need to bind to the callable. Other migrated languages don't
569
+ // currently produce dual emits of this shape, so the rule is a no-op
570
+ // for them today; future languages get the same correctness
571
+ // guarantee for free if they ever do.
572
+ //
573
+ // See `gitnexus/test/integration/resolvers/typescript-hof-callbacks.test.ts`
574
+ // for the cross-file regression this rule prevents.
575
+ let fallback;
544
576
  for (const d of defs) {
545
- if (deriveSimpleName(d) === name)
577
+ if (deriveSimpleName(d) !== name)
578
+ continue;
579
+ if (isCallableOrTypeLike(d.type))
546
580
  return d;
581
+ if (fallback === undefined)
582
+ fallback = d;
547
583
  }
548
- return undefined;
584
+ return fallback;
585
+ }
586
+ const CALLABLE_OR_TYPE_LIKE = new Set([
587
+ 'Function',
588
+ 'Method',
589
+ 'Constructor',
590
+ 'Class',
591
+ 'Interface',
592
+ 'Enum',
593
+ 'Struct',
594
+ 'Record',
595
+ 'Trait',
596
+ 'Namespace',
597
+ 'Module',
598
+ 'TypeAlias',
599
+ 'Type',
600
+ 'Typedef',
601
+ ]);
602
+ function isCallableOrTypeLike(type) {
603
+ return CALLABLE_OR_TYPE_LIKE.has(type);
549
604
  }
550
605
  function countEdgesWithin(edgeIndex, files) {
551
606
  let n = 0;