kodit 0.2.9__tar.gz → 0.3.0__tar.gz

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.

Potentially problematic release.


This version of kodit might be problematic. Click here for more details.

Files changed (205) hide show
  1. {kodit-0.2.9 → kodit-0.3.0}/PKG-INFO +1 -1
  2. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/deployment/docker-compose.yaml +4 -0
  3. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/deployment/kubernetes.yaml +4 -0
  4. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/indexing/index.md +58 -10
  5. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/_version.py +2 -2
  6. kodit-0.3.0/src/kodit/app.py +70 -0
  7. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/cli.py +15 -0
  8. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/config.py +40 -3
  9. kodit-0.3.0/src/kodit/infrastructure/indexing/auto_indexing_service.py +84 -0
  10. kodit-0.3.0/tests/kodit/config_test.py +73 -0
  11. kodit-0.3.0/tests/kodit/infrastructure/indexing/test_auto_indexing_service.py +234 -0
  12. {kodit-0.2.9 → kodit-0.3.0}/tests/smoke.sh +5 -0
  13. kodit-0.2.9/src/kodit/app.py +0 -35
  14. {kodit-0.2.9 → kodit-0.3.0}/.cursor/rules/kodit.mdc +0 -0
  15. {kodit-0.2.9 → kodit-0.3.0}/.cursor/rules/style.mdc +0 -0
  16. {kodit-0.2.9 → kodit-0.3.0}/.dockerignore +0 -0
  17. {kodit-0.2.9 → kodit-0.3.0}/.github/CODE_OF_CONDUCT.md +0 -0
  18. {kodit-0.2.9 → kodit-0.3.0}/.github/CONTRIBUTING.md +0 -0
  19. {kodit-0.2.9 → kodit-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  20. {kodit-0.2.9 → kodit-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  21. {kodit-0.2.9 → kodit-0.3.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  22. {kodit-0.2.9 → kodit-0.3.0}/.github/dependabot.yml +0 -0
  23. {kodit-0.2.9 → kodit-0.3.0}/.github/workflows/docker.yaml +0 -0
  24. {kodit-0.2.9 → kodit-0.3.0}/.github/workflows/docs.yaml +0 -0
  25. {kodit-0.2.9 → kodit-0.3.0}/.github/workflows/pull_request.yaml +0 -0
  26. {kodit-0.2.9 → kodit-0.3.0}/.github/workflows/pypi-test.yaml +0 -0
  27. {kodit-0.2.9 → kodit-0.3.0}/.github/workflows/pypi.yaml +0 -0
  28. {kodit-0.2.9 → kodit-0.3.0}/.github/workflows/test.yaml +0 -0
  29. {kodit-0.2.9 → kodit-0.3.0}/.gitignore +0 -0
  30. {kodit-0.2.9 → kodit-0.3.0}/.python-version +0 -0
  31. {kodit-0.2.9 → kodit-0.3.0}/.vscode/launch.json +0 -0
  32. {kodit-0.2.9 → kodit-0.3.0}/.vscode/settings.json +0 -0
  33. {kodit-0.2.9 → kodit-0.3.0}/Dockerfile +0 -0
  34. {kodit-0.2.9 → kodit-0.3.0}/LICENSE +0 -0
  35. {kodit-0.2.9 → kodit-0.3.0}/README.md +0 -0
  36. {kodit-0.2.9 → kodit-0.3.0}/alembic.ini +0 -0
  37. {kodit-0.2.9 → kodit-0.3.0}/docs/_index.md +0 -0
  38. {kodit-0.2.9 → kodit-0.3.0}/docs/demos/_index.md +0 -0
  39. {kodit-0.2.9 → kodit-0.3.0}/docs/demos/go-simple-microservice/index.md +0 -0
  40. {kodit-0.2.9 → kodit-0.3.0}/docs/demos/knock-knock-auth/index.md +0 -0
  41. {kodit-0.2.9 → kodit-0.3.0}/docs/developer/index.md +0 -0
  42. {kodit-0.2.9 → kodit-0.3.0}/docs/getting-started/_index.md +0 -0
  43. {kodit-0.2.9 → kodit-0.3.0}/docs/getting-started/installation/index.md +0 -0
  44. {kodit-0.2.9 → kodit-0.3.0}/docs/getting-started/integration/index.md +0 -0
  45. {kodit-0.2.9 → kodit-0.3.0}/docs/getting-started/quick-start/index.md +0 -0
  46. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/_index.md +0 -0
  47. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/configuration/index.md +0 -0
  48. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/deployment/index.md +0 -0
  49. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/mcp/index.md +0 -0
  50. {kodit-0.2.9 → kodit-0.3.0}/docs/reference/telemetry/index.md +0 -0
  51. {kodit-0.2.9 → kodit-0.3.0}/pyproject.toml +0 -0
  52. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/.gitignore +0 -0
  53. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/__init__.py +0 -0
  54. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/application/__init__.py +0 -0
  55. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/application/factories/__init__.py +0 -0
  56. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/application/factories/code_indexing_factory.py +0 -0
  57. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/application/services/__init__.py +0 -0
  58. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/application/services/code_indexing_application_service.py +0 -0
  59. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/database.py +0 -0
  60. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/__init__.py +0 -0
  61. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/entities.py +0 -0
  62. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/enums.py +0 -0
  63. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/errors.py +0 -0
  64. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/interfaces.py +0 -0
  65. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/repositories.py +0 -0
  66. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/__init__.py +0 -0
  67. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/bm25_service.py +0 -0
  68. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/embedding_service.py +0 -0
  69. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/enrichment_service.py +0 -0
  70. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/ignore_service.py +0 -0
  71. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/indexing_service.py +0 -0
  72. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/snippet_extraction_service.py +0 -0
  73. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/snippet_service.py +0 -0
  74. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/services/source_service.py +0 -0
  75. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/domain/value_objects.py +0 -0
  76. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/__init__.py +0 -0
  77. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/bm25/__init__.py +0 -0
  78. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/bm25/bm25_factory.py +0 -0
  79. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/bm25/local_bm25_repository.py +0 -0
  80. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/bm25/vectorchord_bm25_repository.py +0 -0
  81. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/__init__.py +0 -0
  82. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/folder/__init__.py +0 -0
  83. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/folder/factory.py +0 -0
  84. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/folder/working_copy.py +0 -0
  85. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/git/__init__.py +0 -0
  86. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/git/factory.py +0 -0
  87. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/git/working_copy.py +0 -0
  88. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/cloning/metadata.py +0 -0
  89. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/__init__.py +0 -0
  90. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/embedding_factory.py +0 -0
  91. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/embedding_providers/__init__.py +0 -0
  92. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/embedding_providers/batching.py +0 -0
  93. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/embedding_providers/hash_embedding_provider.py +0 -0
  94. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/embedding_providers/local_embedding_provider.py +0 -0
  95. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/embedding_providers/openai_embedding_provider.py +0 -0
  96. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/local_vector_search_repository.py +0 -0
  97. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +0 -0
  98. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/enrichment/__init__.py +0 -0
  99. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/enrichment/enrichment_factory.py +0 -0
  100. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/enrichment/local_enrichment_provider.py +0 -0
  101. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/enrichment/null_enrichment_provider.py +0 -0
  102. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/enrichment/openai_enrichment_provider.py +0 -0
  103. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/git/__init__.py +0 -0
  104. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/git/git_utils.py +0 -0
  105. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/ignore/__init__.py +0 -0
  106. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/ignore/ignore_pattern_provider.py +0 -0
  107. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/indexing/__init__.py +0 -0
  108. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/indexing/fusion_service.py +0 -0
  109. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/indexing/index_repository.py +0 -0
  110. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/indexing/indexing_factory.py +0 -0
  111. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/indexing/snippet_domain_service_factory.py +0 -0
  112. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/__init__.py +0 -0
  113. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/language_detection_service.py +0 -0
  114. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/languages/csharp.scm +0 -0
  115. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/languages/go.scm +0 -0
  116. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/languages/java.scm +0 -0
  117. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/languages/javascript.scm +0 -0
  118. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/languages/python.scm +0 -0
  119. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/languages/typescript.scm +0 -0
  120. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/snippet_extraction_factory.py +0 -0
  121. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/snippet_query_provider.py +0 -0
  122. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/snippet_extraction/tree_sitter_snippet_extractor.py +0 -0
  123. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
  124. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/sqlalchemy/embedding_repository.py +0 -0
  125. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/sqlalchemy/file_repository.py +0 -0
  126. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/sqlalchemy/repository.py +0 -0
  127. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/sqlalchemy/snippet_repository.py +0 -0
  128. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/ui/__init__.py +0 -0
  129. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/ui/progress.py +0 -0
  130. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/infrastructure/ui/spinner.py +0 -0
  131. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/log.py +0 -0
  132. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/mcp.py +0 -0
  133. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/middleware.py +0 -0
  134. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/README +0 -0
  135. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/__init__.py +0 -0
  136. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/env.py +0 -0
  137. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/script.py.mako +0 -0
  138. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +0 -0
  139. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/versions/85155663351e_initial.py +0 -0
  140. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/versions/9e53ea8bb3b0_add_authors.py +0 -0
  141. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/versions/__init__.py +0 -0
  142. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +0 -0
  143. {kodit-0.2.9 → kodit-0.3.0}/src/kodit/reporting.py +0 -0
  144. {kodit-0.2.9 → kodit-0.3.0}/tests/__init__.py +0 -0
  145. {kodit-0.2.9 → kodit-0.3.0}/tests/conftest.py +0 -0
  146. {kodit-0.2.9 → kodit-0.3.0}/tests/docker-smoke.sh +0 -0
  147. {kodit-0.2.9 → kodit-0.3.0}/tests/experiments/__init__.py +0 -0
  148. {kodit-0.2.9 → kodit-0.3.0}/tests/experiments/cline_prompt_tests/__init__.py +0 -0
  149. {kodit-0.2.9 → kodit-0.3.0}/tests/experiments/cline_prompt_tests/cline_prompt.txt +0 -0
  150. {kodit-0.2.9 → kodit-0.3.0}/tests/experiments/cline_prompt_tests/cline_prompt_test.py +0 -0
  151. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/__init__.py +0 -0
  152. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/application/__init__.py +0 -0
  153. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/application/test_code_indexing_application_service.py +0 -0
  154. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/cli_test.py +0 -0
  155. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/domain/__init__.py +0 -0
  156. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/domain/bm25_domain_service_test.py +0 -0
  157. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/domain/enrichment_domain_service_test.py +0 -0
  158. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/domain/snippet_domain_service_test.py +0 -0
  159. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/domain/snippet_extraction_domain_service_test.py +0 -0
  160. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/domain/test_embedding_service.py +0 -0
  161. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/domain/test_language_mapping.py +0 -0
  162. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/e2e.py +0 -0
  163. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/__init__.py +0 -0
  164. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/cloning/git_cloning/__init__.py +0 -0
  165. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/cloning/git_cloning/factory_test.py +0 -0
  166. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/cloning/git_cloning/working_copy_test.py +0 -0
  167. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/__init__.py +0 -0
  168. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/embedding_factory_test.py +0 -0
  169. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/embedding_provider/__init__.py +0 -0
  170. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/embedding_provider/test_hash_embedding_provider.py +0 -0
  171. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/embedding_provider/test_local_embedding_provider.py +0 -0
  172. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/embedding_provider/test_openai_embedding_provider.py +0 -0
  173. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/test_batching.py +0 -0
  174. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/test_embedding_integration.py +0 -0
  175. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/test_local_vector_search_repository.py +0 -0
  176. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/embedding/test_vectorchord_vector_search_repository.py +0 -0
  177. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/enrichment/__init__.py +0 -0
  178. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/enrichment/enrichment_provider/__init__.py +0 -0
  179. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_local_enrichment_provider.py +0 -0
  180. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_null_enrichment_provider.py +0 -0
  181. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_openai_enrichment_provider.py +0 -0
  182. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/enrichment/test_enrichment_factory.py +0 -0
  183. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/git/__init__.py +0 -0
  184. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/git/test_git_utils.py +0 -0
  185. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/indexing/__init__.py +0 -0
  186. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/indexing/indexing_repository_test.py +0 -0
  187. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/snippets/__init__.py +0 -0
  188. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/snippets/csharp.cs +0 -0
  189. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/snippets/golang.go +0 -0
  190. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/snippets/javascript.js +0 -0
  191. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/snippets/knock_knock_server.py +0 -0
  192. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/snippets/python.py +0 -0
  193. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/snippets/typescript.tsx +0 -0
  194. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/source/__init__.py +0 -0
  195. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/source/source_service_test.py +0 -0
  196. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
  197. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/sqlalchemy/test_embedding_repository.py +0 -0
  198. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/sqlalchemy/test_snippet_repository.py +0 -0
  199. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/infrastructure/test_vectorchord_bm25_repository.py +0 -0
  200. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/log_test.py +0 -0
  201. {kodit-0.2.9 → kodit-0.3.0}/tests/kodit/mcp_test.py +0 -0
  202. {kodit-0.2.9 → kodit-0.3.0}/tests/performance/__init__.py +0 -0
  203. {kodit-0.2.9 → kodit-0.3.0}/tests/performance/similarity.py +0 -0
  204. {kodit-0.2.9 → kodit-0.3.0}/tests/vectorchord-smoke.sh +0 -0
  205. {kodit-0.2.9 → kodit-0.3.0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kodit
3
- Version: 0.2.9
3
+ Version: 0.3.0
4
4
  Summary: Code indexing for better AI code generation
5
5
  Project-URL: Homepage, https://docs.helixml.tech/kodit/
6
6
  Project-URL: Documentation, https://docs.helixml.tech/kodit/
@@ -29,6 +29,10 @@ services:
29
29
  ENRICHMENT_ENDPOINT_API_KEY: REPLACE_WITH_YOUR_API_KEY
30
30
  ENRICHMENT_ENDPOINT_MODEL: o3-mini
31
31
 
32
+ # Auto-indexing configuration
33
+ AUTO_INDEXING_SOURCES_0_URI: https://github.com/pydantic/pydantic
34
+ AUTO_INDEXING_SOURCES_1_URI: https://github.com/fastapi/fastapi
35
+ AUTO_INDEXING_SOURCES_2_URI: https://github.com/helix-ml/kodit
32
36
 
33
37
  vectorchord:
34
38
  image: tensorchord/vchord-suite:pg17-20250601
@@ -77,6 +77,10 @@ spec:
77
77
  value: "REPLACE_WITH_YOUR_API_KEY"
78
78
  - name: ENRICHMENT_ENDPOINT_MODEL
79
79
  value: "o3-mini"
80
+ - name: AUTO_INDEXING_SOURCES_0_URI
81
+ value: "https://github.com/pydantic/pydantic"
82
+ - name: AUTO_INDEXING_SOURCES_1_URI
83
+ value: "https://github.com/helix-ml/kodit"
80
84
  ports:
81
85
  - containerPort: 8080
82
86
  readinessProbe:
@@ -42,7 +42,7 @@ Kodit can index local directories on your filesystem:
42
42
 
43
43
  ## Basic Usage
44
44
 
45
- ### Indexing a Source
45
+ ### Manual Indexing
46
46
 
47
47
  To index a source, use the `kodit index` command followed by the source location:
48
48
 
@@ -75,6 +75,61 @@ This will display a table showing:
75
75
  - Source URI
76
76
  - Number of snippets extracted
77
77
 
78
+ ### Auto-Indexing
79
+
80
+ If you're running Kodit as a shared server, you need to configure what gets indexed.
81
+ Auto-indexing is a simple indexing configuration powered by environmental variables.
82
+
83
+ #### Configuration via Environment Variables
84
+
85
+ Configure auto-indexing sources using environment variables with the `AUTO_INDEXING_SOURCES_{X}_` prefix:
86
+
87
+ ```sh
88
+ # Configure a single auto-index source
89
+ export AUTO_INDEXING_SOURCES_0_URI="https://github.com/pydantic/pydantic"
90
+
91
+ # Configure multiple auto-index sources
92
+ export AUTO_INDEXING_SOURCES_0_URI="https://github.com/pydantic/pydantic"
93
+ export AUTO_INDEXING_SOURCES_1_URI="https://github.com/fastapi/fastapi"
94
+ export AUTO_INDEXING_SOURCES_2_URI="/path/to/local/project"
95
+
96
+ # Or use a .env file
97
+ echo "AUTO_INDEXING_SOURCES_0_URI=https://github.com/pydantic/pydantic" >> .env
98
+ echo "AUTO_INDEXING_SOURCES_1_URI=https://github.com/fastapi/fastapi" >> .env
99
+ echo "AUTO_INDEXING_SOURCES_2_URI=/path/to/local/project" >> .env
100
+ ```
101
+
102
+ **Configuration Format:**
103
+
104
+ - Use `AUTO_INDEXING_SOURCES_N_URI` where `N` is a zero-based index
105
+ - Sources are indexed in numerical order (0, 1, 2, etc.)
106
+ - Supports all source types: Git repositories (HTTPS/SSH) and local directories
107
+ - Gaps in numbering are allowed (e.g., 0, 2, 5 will work)
108
+
109
+ #### Using Auto-Indexing
110
+
111
+ To manually index all configured auto-index sources:
112
+
113
+ ```sh
114
+ kodit index --auto-index
115
+ ```
116
+
117
+ This command will:
118
+
119
+ 1. Read the auto-indexing configuration from environment variables
120
+ 2. Index each configured source in sequence
121
+ 3. Show progress for each source being indexed
122
+ 4. Handle errors gracefully and continue with remaining sources
123
+
124
+ If no auto-index sources are configured, the command will display a message indicating
125
+ that no sources are configured.
126
+
127
+ To automatically run index all configured auto-index sources:
128
+
129
+ ```sh
130
+ kodit serve
131
+ ```
132
+
78
133
  ## Git Protocol Support
79
134
 
80
135
  ### HTTPS Authentication
@@ -226,15 +281,6 @@ Kodit shows progress during indexing operations:
226
281
  - Snippet extraction progress
227
282
  - Index building progress (BM25, embeddings)
228
283
 
229
- ### Error Handling
230
-
231
- Common issues and solutions:
232
-
233
- 1. **Authentication Errors**: Ensure your credentials are correct
234
- 2. **Network Issues**: Check your internet connection and firewall settings
235
- 3. **Permission Errors**: Ensure you have read access to the source
236
- 4. **Unsupported Files**: Kodit will skip unsupported file types automatically
237
-
238
284
  ## Privacy and Security
239
285
 
240
286
  ### Local Processing
@@ -265,6 +311,8 @@ Kodit respects privacy by honoring:
265
311
  2. **"Unsupported source"**: Ensure the path or URL is valid and accessible
266
312
  3. **"No snippets found"**: Check if the source contains supported file types
267
313
  4. **"Permission denied"**: Ensure you have read access to the source
314
+ 5. **"No auto-index sources configured"**: Check your environment variables are set correctly
315
+ 6. **"Auto-indexing configuration error"**: Verify the environment variable format uses `AUTO_INDEXING_SOURCES_N_URI`
268
316
 
269
317
  ### Checking Index Status
270
318
 
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.2.9'
21
- __version_tuple__ = version_tuple = (0, 2, 9)
20
+ __version__ = version = '0.3.0'
21
+ __version_tuple__ = version_tuple = (0, 3, 0)
@@ -0,0 +1,70 @@
1
+ """FastAPI application for kodit API."""
2
+
3
+ from collections.abc import AsyncIterator
4
+ from contextlib import asynccontextmanager
5
+
6
+ from asgi_correlation_id import CorrelationIdMiddleware
7
+ from fastapi import FastAPI
8
+
9
+ from kodit.config import AppContext
10
+ from kodit.infrastructure.indexing.auto_indexing_service import AutoIndexingService
11
+ from kodit.mcp import mcp
12
+ from kodit.middleware import ASGICancelledErrorMiddleware, logging_middleware
13
+
14
+ # Global auto-indexing service
15
+ _auto_indexing_service: AutoIndexingService | None = None
16
+
17
+
18
+ @asynccontextmanager
19
+ async def app_lifespan(_: FastAPI) -> AsyncIterator[None]:
20
+ """Manage application lifespan for auto-indexing."""
21
+ global _auto_indexing_service # noqa: PLW0603
22
+ # Start auto-indexing service
23
+ app_context = AppContext()
24
+ db = await app_context.get_db()
25
+ _auto_indexing_service = AutoIndexingService(
26
+ app_context=app_context,
27
+ session_factory=db.session_factory,
28
+ )
29
+ await _auto_indexing_service.start_background_indexing()
30
+ yield
31
+ if _auto_indexing_service:
32
+ await _auto_indexing_service.stop()
33
+
34
+
35
+ # See https://gofastmcp.com/deployment/asgi#fastapi-integration
36
+ mcp_app = mcp.sse_app()
37
+
38
+
39
+ @asynccontextmanager
40
+ async def combined_lifespan(app: FastAPI) -> AsyncIterator[None]:
41
+ """Combine app and MCP lifespans."""
42
+ async with app_lifespan(app), mcp_app.router.lifespan_context(app):
43
+ yield
44
+
45
+
46
+ app = FastAPI(title="kodit API", lifespan=combined_lifespan)
47
+
48
+ # Add middleware
49
+ app.middleware("http")(logging_middleware)
50
+ app.add_middleware(CorrelationIdMiddleware)
51
+
52
+
53
+ @app.get("/")
54
+ async def root() -> dict[str, str]:
55
+ """Return a welcome message for the kodit API."""
56
+ return {"message": "Hello, World!"}
57
+
58
+
59
+ @app.get("/healthz")
60
+ async def healthz() -> dict[str, str]:
61
+ """Return a health check for the kodit API."""
62
+ return {"status": "ok"}
63
+
64
+
65
+ # Add mcp routes last, otherwise previous routes aren't added
66
+ app.mount("", mcp_app)
67
+
68
+ # Wrap the entire app with ASGI middleware after all routes are added to suppress
69
+ # CancelledError at the ASGI level
70
+ app = ASGICancelledErrorMiddleware(app)
@@ -59,12 +59,17 @@ def cli(
59
59
 
60
60
  @cli.command()
61
61
  @click.argument("sources", nargs=-1)
62
+ @click.option(
63
+ "--auto-index", is_flag=True, help="Index all configured auto-index sources"
64
+ )
62
65
  @with_app_context
63
66
  @with_session
64
67
  async def index(
65
68
  session: AsyncSession,
66
69
  app_context: AppContext,
67
70
  sources: list[str],
71
+ *, # Force keyword-only arguments
72
+ auto_index: bool,
68
73
  ) -> None:
69
74
  """List indexes, or index data sources."""
70
75
  log = structlog.get_logger(__name__)
@@ -78,6 +83,16 @@ async def index(
78
83
  source_service=source_service,
79
84
  )
80
85
 
86
+ if auto_index:
87
+ log.info("Auto-indexing configuration", config=app_context.auto_indexing)
88
+ auto_sources = app_context.auto_indexing.sources
89
+ if not auto_sources:
90
+ click.echo("No auto-index sources configured.")
91
+ return
92
+
93
+ click.echo(f"Auto-indexing {len(auto_sources)} configured sources...")
94
+ sources = [source.uri for source in auto_sources]
95
+
81
96
  if not sources:
82
97
  log_event("kodit.cli.index.list")
83
98
  # No source specified, list all indexes
@@ -8,7 +8,7 @@ from pathlib import Path
8
8
  from typing import TYPE_CHECKING, Any, Literal, TypeVar
9
9
 
10
10
  import click
11
- from pydantic import BaseModel, Field
11
+ from pydantic import BaseModel, Field, field_validator
12
12
  from pydantic_settings import BaseSettings, SettingsConfigDict
13
13
 
14
14
  if TYPE_CHECKING:
@@ -37,11 +37,45 @@ class Endpoint(BaseModel):
37
37
 
38
38
 
39
39
  class Search(BaseModel):
40
- """Search provides configuration for a search engine."""
40
+ """Search configuration."""
41
41
 
42
42
  provider: Literal["sqlite", "vectorchord"] = Field(default="sqlite")
43
43
 
44
44
 
45
+ class AutoIndexingSource(BaseModel):
46
+ """Configuration for a single auto-indexing source."""
47
+
48
+ uri: str = Field(description="URI of the source to index (git URL or local path)")
49
+
50
+
51
+ class AutoIndexingConfig(BaseModel):
52
+ """Configuration for auto-indexing."""
53
+
54
+ sources: list[AutoIndexingSource] = Field(
55
+ default_factory=list, description="List of sources to auto-index"
56
+ )
57
+
58
+ @field_validator("sources", mode="before")
59
+ @classmethod
60
+ def parse_sources(cls, v: Any) -> list[AutoIndexingSource]:
61
+ """Parse sources from environment variables or other formats."""
62
+ if v is None:
63
+ return []
64
+ if isinstance(v, list):
65
+ return v
66
+ if isinstance(v, dict):
67
+ # Handle case where env vars are numbered keys like {'0': {'uri': '...'}}
68
+ sources = []
69
+ i = 0
70
+ while str(i) in v:
71
+ source_data = v[str(i)]
72
+ if isinstance(source_data, dict) and "uri" in source_data:
73
+ sources.append(AutoIndexingSource(uri=source_data["uri"]))
74
+ i += 1
75
+ return sources
76
+ return v
77
+
78
+
45
79
  class AppContext(BaseSettings):
46
80
  """Global context for the kodit project. Provides a shared state for the app."""
47
81
 
@@ -50,7 +84,7 @@ class AppContext(BaseSettings):
50
84
  env_file_encoding="utf-8",
51
85
  env_nested_delimiter="_",
52
86
  nested_model_default_partial_update=True,
53
- env_nested_max_split=1,
87
+ extra="ignore",
54
88
  )
55
89
 
56
90
  data_dir: Path = Field(default=DEFAULT_BASE_DIR)
@@ -76,6 +110,9 @@ class AppContext(BaseSettings):
76
110
  default_search: Search = Field(
77
111
  default=Search(),
78
112
  )
113
+ auto_indexing: AutoIndexingConfig | None = Field(
114
+ default=AutoIndexingConfig(), description="Auto-indexing configuration"
115
+ )
79
116
  _db: Database | None = None
80
117
 
81
118
  def model_post_init(self, _: Any) -> None:
@@ -0,0 +1,84 @@
1
+ """Service for automatically indexing configured sources."""
2
+
3
+ import asyncio
4
+ from collections.abc import Callable
5
+ from contextlib import suppress
6
+
7
+ import structlog
8
+ from sqlalchemy.ext.asyncio import AsyncSession
9
+
10
+ from kodit.application.factories.code_indexing_factory import (
11
+ create_code_indexing_application_service,
12
+ )
13
+ from kodit.config import AppContext
14
+ from kodit.domain.services.source_service import SourceService
15
+
16
+
17
+ class AutoIndexingService:
18
+ """Service for automatically indexing configured sources."""
19
+
20
+ def __init__(
21
+ self,
22
+ app_context: AppContext,
23
+ session_factory: Callable[[], AsyncSession],
24
+ ) -> None:
25
+ """Initialize the auto-indexing service."""
26
+ self.app_context = app_context
27
+ self.session_factory = session_factory
28
+ self.log = structlog.get_logger(__name__)
29
+ self._indexing_task: asyncio.Task | None = None
30
+
31
+ async def start_background_indexing(self) -> None:
32
+ """Start background indexing of configured sources."""
33
+ if (
34
+ not self.app_context.auto_indexing
35
+ or len(self.app_context.auto_indexing.sources) == 0
36
+ ):
37
+ self.log.info("Auto-indexing is disabled (no sources configured)")
38
+ return
39
+
40
+ auto_sources = [source.uri for source in self.app_context.auto_indexing.sources]
41
+ self.log.info("Starting background indexing", num_sources=len(auto_sources))
42
+ self._indexing_task = asyncio.create_task(self._index_sources(auto_sources))
43
+
44
+ async def _index_sources(self, sources: list[str]) -> None:
45
+ """Index all configured sources in the background."""
46
+ async with self.session_factory() as session:
47
+ source_service = SourceService(
48
+ clone_dir=self.app_context.get_clone_dir(),
49
+ session_factory=lambda: session,
50
+ )
51
+
52
+ service = create_code_indexing_application_service(
53
+ app_context=self.app_context,
54
+ session=session,
55
+ source_service=source_service,
56
+ )
57
+
58
+ for source in sources:
59
+ try:
60
+ self.log.info("Auto-indexing source", source=source)
61
+
62
+ # Create source
63
+ s = await source_service.create(source)
64
+
65
+ # Create index
66
+ index = await service.create_index(s.id)
67
+
68
+ # Run indexing (without progress callback for background mode)
69
+ await service.run_index(index.id, progress_callback=None)
70
+
71
+ self.log.info("Successfully auto-indexed source", source=source)
72
+
73
+ except Exception as exc:
74
+ self.log.exception(
75
+ "Failed to auto-index source", source=source, error=str(exc)
76
+ )
77
+ # Continue with other sources even if one fails
78
+
79
+ async def stop(self) -> None:
80
+ """Stop background indexing."""
81
+ if self._indexing_task:
82
+ self._indexing_task.cancel()
83
+ with suppress(asyncio.CancelledError):
84
+ await self._indexing_task
@@ -0,0 +1,73 @@
1
+ """Tests for configuration classes."""
2
+
3
+ import os
4
+
5
+ from kodit.config import AppContext, AutoIndexingConfig, AutoIndexingSource
6
+
7
+
8
+ class TestAutoIndexingSource:
9
+ """Test the AutoIndexingSource configuration class."""
10
+
11
+ def test_auto_indexing_source_creation(self) -> None:
12
+ """Test creating an AutoIndexingSource."""
13
+ source = AutoIndexingSource(uri="https://github.com/test/repo")
14
+ assert source.uri == "https://github.com/test/repo"
15
+
16
+
17
+ class TestAutoIndexingConfig:
18
+ """Test the AutoIndexingConfig configuration class."""
19
+
20
+ def test_auto_indexing_config_empty(self) -> None:
21
+ """Test empty auto-indexing configuration."""
22
+ config = AutoIndexingConfig()
23
+ assert config.sources == []
24
+
25
+ def test_auto_indexing_config_with_sources(self) -> None:
26
+ """Test auto-indexing configuration with sources."""
27
+ sources = [
28
+ AutoIndexingSource(uri="https://github.com/test/repo1"),
29
+ AutoIndexingSource(uri="https://github.com/test/repo2"),
30
+ ]
31
+ config = AutoIndexingConfig(sources=sources)
32
+ assert len(config.sources) == 2
33
+ assert config.sources[0].uri == "https://github.com/test/repo1"
34
+ assert config.sources[1].uri == "https://github.com/test/repo2"
35
+
36
+
37
+ class TestAppContextAutoIndexing:
38
+ """Test auto-indexing functionality in AppContext."""
39
+
40
+ def test_get_auto_index_sources_empty(self) -> None:
41
+ """Test getting auto-index sources when none are configured."""
42
+ app_context = AppContext()
43
+ sources = app_context.auto_indexing.sources
44
+ assert sources == []
45
+
46
+ def test_get_auto_index_sources_with_config(self) -> None:
47
+ """Test getting auto-index sources when configured."""
48
+ auto_sources = [
49
+ AutoIndexingSource(uri="https://github.com/test/repo1"),
50
+ AutoIndexingSource(uri="/local/path/to/repo"),
51
+ ]
52
+ app_context = AppContext(auto_indexing=AutoIndexingConfig(sources=auto_sources))
53
+ sources = app_context.auto_indexing.sources
54
+ assert sources == auto_sources
55
+
56
+ def test_auto_indexing_from_environment_variables(self) -> None:
57
+ """Test auto-indexing configuration from environment variables."""
58
+ # Set environment variables for auto-indexing
59
+ os.environ["AUTO_INDEXING_SOURCES_0_URI"] = "https://github.com/test/repo1"
60
+ os.environ["AUTO_INDEXING_SOURCES_1_URI"] = "https://github.com/test/repo2"
61
+
62
+ try:
63
+ app_context = AppContext()
64
+ sources = app_context.auto_indexing.sources
65
+ uris = [source.uri for source in sources]
66
+ assert uris == [
67
+ "https://github.com/test/repo1",
68
+ "https://github.com/test/repo2",
69
+ ]
70
+ finally:
71
+ # Clean up environment variables
72
+ del os.environ["AUTO_INDEXING_SOURCES_0_URI"]
73
+ del os.environ["AUTO_INDEXING_SOURCES_1_URI"]