kodit 0.3.0__tar.gz → 0.3.1__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.
- kodit-0.3.1/.claude/commands/debug.md +121 -0
- kodit-0.3.1/.claude/commands/refactor.md +33 -0
- kodit-0.3.1/.claude/settings.json +3 -0
- kodit-0.3.1/CLAUDE.md +99 -0
- {kodit-0.3.0 → kodit-0.3.1}/PKG-INFO +14 -4
- {kodit-0.3.0 → kodit-0.3.1}/README.md +13 -3
- {kodit-0.3.0 → kodit-0.3.1}/docs/_index.md +12 -2
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/_version.py +2 -2
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/application/services/code_indexing_application_service.py +5 -6
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/cli.py +5 -27
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/config.py +62 -4
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/indexing_service.py +4 -3
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/snippet_service.py +16 -3
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/value_objects.py +35 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/indexing/index_repository.py +6 -24
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/mcp.py +1 -1
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/config_test.py +40 -3
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/domain/snippet_domain_service_test.py +22 -6
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/indexing/indexing_repository_test.py +4 -4
- {kodit-0.3.0 → kodit-0.3.1}/.cursor/rules/kodit.mdc +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.cursor/rules/style.mdc +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.dockerignore +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/CODE_OF_CONDUCT.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/CONTRIBUTING.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/dependabot.yml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/workflows/docker.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/workflows/docs.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/workflows/pull_request.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/workflows/pypi-test.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/workflows/pypi.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.github/workflows/test.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.gitignore +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.python-version +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.vscode/launch.json +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/.vscode/settings.json +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/Dockerfile +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/LICENSE +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/alembic.ini +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/demos/_index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/demos/go-simple-microservice/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/demos/knock-knock-auth/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/developer/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/getting-started/_index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/getting-started/installation/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/getting-started/integration/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/getting-started/quick-start/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/_index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/configuration/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/deployment/docker-compose.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/deployment/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/deployment/kubernetes.yaml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/indexing/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/mcp/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/docs/reference/telemetry/index.md +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/pyproject.toml +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/.gitignore +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/app.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/application/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/application/factories/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/application/factories/code_indexing_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/application/services/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/database.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/entities.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/enums.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/errors.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/interfaces.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/repositories.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/bm25_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/embedding_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/enrichment_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/ignore_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/snippet_extraction_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/domain/services/source_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/bm25/bm25_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/bm25/local_bm25_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/bm25/vectorchord_bm25_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/folder/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/folder/factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/folder/working_copy.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/git/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/git/factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/git/working_copy.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/cloning/metadata.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/embedding_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/embedding_providers/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/embedding_providers/batching.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/embedding_providers/hash_embedding_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/embedding_providers/local_embedding_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/embedding_providers/openai_embedding_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/local_vector_search_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/enrichment/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/enrichment/enrichment_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/enrichment/local_enrichment_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/enrichment/null_enrichment_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/enrichment/openai_enrichment_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/git/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/git/git_utils.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/ignore/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/ignore/ignore_pattern_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/indexing/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/indexing/auto_indexing_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/indexing/fusion_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/indexing/indexing_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/indexing/snippet_domain_service_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/language_detection_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/languages/csharp.scm +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/languages/go.scm +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/languages/java.scm +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/languages/javascript.scm +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/languages/python.scm +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/languages/typescript.scm +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/snippet_extraction_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/snippet_query_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/snippet_extraction/tree_sitter_snippet_extractor.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/sqlalchemy/embedding_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/sqlalchemy/file_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/sqlalchemy/repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/sqlalchemy/snippet_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/ui/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/ui/progress.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/infrastructure/ui/spinner.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/log.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/middleware.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/README +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/env.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/script.py.mako +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/versions/85155663351e_initial.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/versions/9e53ea8bb3b0_add_authors.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/versions/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/src/kodit/reporting.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/conftest.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/docker-smoke.sh +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/experiments/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/experiments/cline_prompt_tests/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/experiments/cline_prompt_tests/cline_prompt.txt +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/experiments/cline_prompt_tests/cline_prompt_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/application/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/application/test_code_indexing_application_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/cli_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/domain/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/domain/bm25_domain_service_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/domain/enrichment_domain_service_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/domain/snippet_extraction_domain_service_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/domain/test_embedding_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/domain/test_language_mapping.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/e2e.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/cloning/git_cloning/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/cloning/git_cloning/factory_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/cloning/git_cloning/working_copy_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/embedding_factory_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/embedding_provider/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/embedding_provider/test_hash_embedding_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/embedding_provider/test_local_embedding_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/embedding_provider/test_openai_embedding_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/test_batching.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/test_embedding_integration.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/test_local_vector_search_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/embedding/test_vectorchord_vector_search_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/enrichment/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/enrichment/enrichment_provider/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_local_enrichment_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_null_enrichment_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/enrichment/enrichment_provider/test_openai_enrichment_provider.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/enrichment/test_enrichment_factory.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/git/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/git/test_git_utils.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/indexing/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/indexing/test_auto_indexing_service.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/snippets/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/snippets/csharp.cs +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/snippets/golang.go +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/snippets/javascript.js +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/snippets/knock_knock_server.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/snippets/python.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/snippets/typescript.tsx +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/source/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/source/source_service_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/sqlalchemy/test_embedding_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/sqlalchemy/test_snippet_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/infrastructure/test_vectorchord_bm25_repository.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/log_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/kodit/mcp_test.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/performance/__init__.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/performance/similarity.py +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/smoke.sh +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/tests/vectorchord-smoke.sh +0 -0
- {kodit-0.3.0 → kodit-0.3.1}/uv.lock +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Debug Error Command
|
|
2
|
+
|
|
3
|
+
Systematically debug and resolve errors in any codebase using a structured approach.
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
Follow this comprehensive debugging methodology to resolve: **$ARGUMENTS**
|
|
8
|
+
|
|
9
|
+
1. **Error Information Gathering**
|
|
10
|
+
- Collect the complete error message, stack trace, and error code
|
|
11
|
+
- Note when the error occurs (timing, conditions, frequency)
|
|
12
|
+
- Identify the environment where the error happens (dev, staging, prod)
|
|
13
|
+
- Gather relevant logs from before and after the error
|
|
14
|
+
|
|
15
|
+
2. **Reproduce the Error**
|
|
16
|
+
- Create a minimal test case that reproduces the error consistently
|
|
17
|
+
- Document the exact steps needed to trigger the error
|
|
18
|
+
- Test in different environments if possible
|
|
19
|
+
- Note any patterns or conditions that affect error occurrence
|
|
20
|
+
|
|
21
|
+
3. **Stack Trace Analysis**
|
|
22
|
+
- Read the stack trace from bottom to top to understand the call chain
|
|
23
|
+
- Identify the exact line where the error originates
|
|
24
|
+
- Trace the execution path leading to the error
|
|
25
|
+
- Look for any obvious issues in the failing code
|
|
26
|
+
|
|
27
|
+
4. **Code Context Investigation**
|
|
28
|
+
- Examine the code around the error location
|
|
29
|
+
- Check recent changes that might have introduced the bug
|
|
30
|
+
- Review variable values and state at the time of error
|
|
31
|
+
- Analyze function parameters and return values
|
|
32
|
+
|
|
33
|
+
5. **Hypothesis Formation**
|
|
34
|
+
- Based on evidence, form hypotheses about the root cause
|
|
35
|
+
- Consider common causes:
|
|
36
|
+
- Null pointer/undefined reference
|
|
37
|
+
- Type mismatches
|
|
38
|
+
- Race conditions
|
|
39
|
+
- Resource exhaustion
|
|
40
|
+
- Logic errors
|
|
41
|
+
- External dependency failures
|
|
42
|
+
|
|
43
|
+
6. **Debugging Tools Setup**
|
|
44
|
+
- Set up appropriate debugging tools for the technology stack
|
|
45
|
+
- Use debugger, profiler, or logging as needed
|
|
46
|
+
- Configure breakpoints at strategic locations
|
|
47
|
+
- Set up monitoring and alerting if not already present
|
|
48
|
+
|
|
49
|
+
7. **Systematic Investigation**
|
|
50
|
+
- Test each hypothesis methodically
|
|
51
|
+
- Use binary search approach to isolate the problem
|
|
52
|
+
- Add strategic logging or print statements
|
|
53
|
+
- Check data flow and transformations step by step
|
|
54
|
+
|
|
55
|
+
8. **Data Validation**
|
|
56
|
+
- Verify input data format and validity
|
|
57
|
+
- Check for edge cases and boundary conditions
|
|
58
|
+
- Validate assumptions about data state
|
|
59
|
+
- Test with different data sets to isolate patterns
|
|
60
|
+
|
|
61
|
+
9. **Dependency Analysis**
|
|
62
|
+
- Check external dependencies and their versions
|
|
63
|
+
- Verify network connectivity and API availability
|
|
64
|
+
- Review configuration files and environment variables
|
|
65
|
+
- Test database connections and query execution
|
|
66
|
+
|
|
67
|
+
10. **Memory and Resource Analysis**
|
|
68
|
+
- Check for memory leaks or excessive memory usage
|
|
69
|
+
- Monitor CPU and I/O resource consumption
|
|
70
|
+
- Analyze garbage collection patterns if applicable
|
|
71
|
+
- Check for resource deadlocks or contention
|
|
72
|
+
|
|
73
|
+
11. **Concurrency Issues Investigation**
|
|
74
|
+
- Look for race conditions in multi-threaded code
|
|
75
|
+
- Check synchronization mechanisms and locks
|
|
76
|
+
- Analyze async operations and promise handling
|
|
77
|
+
- Test under different load conditions
|
|
78
|
+
|
|
79
|
+
12. **Root Cause Identification**
|
|
80
|
+
- Once the cause is identified, understand why it happened
|
|
81
|
+
- Determine if it's a logic error, design flaw, or external issue
|
|
82
|
+
- Assess the scope and impact of the problem
|
|
83
|
+
- Consider if similar issues exist elsewhere
|
|
84
|
+
|
|
85
|
+
13. **Solution Implementation**
|
|
86
|
+
- Design a fix that addresses the root cause
|
|
87
|
+
- Consider multiple solution approaches and trade-offs
|
|
88
|
+
- Implement the fix with appropriate error handling
|
|
89
|
+
- Add validation and defensive programming where needed
|
|
90
|
+
|
|
91
|
+
14. **Testing the Fix**
|
|
92
|
+
- Test the fix against the original error case
|
|
93
|
+
- Test edge cases and related scenarios
|
|
94
|
+
- Run regression tests to ensure no new issues
|
|
95
|
+
- Test under various load and stress conditions
|
|
96
|
+
|
|
97
|
+
15. **Prevention Measures**
|
|
98
|
+
- Add appropriate unit and integration tests
|
|
99
|
+
- Improve error handling and logging
|
|
100
|
+
- Add input validation and defensive checks
|
|
101
|
+
- Update documentation and code comments
|
|
102
|
+
|
|
103
|
+
16. **Monitoring and Alerting**
|
|
104
|
+
- Set up monitoring for similar issues
|
|
105
|
+
- Add metrics and health checks
|
|
106
|
+
- Configure alerts for error thresholds
|
|
107
|
+
- Implement better observability
|
|
108
|
+
|
|
109
|
+
17. **Documentation**
|
|
110
|
+
- Document the error, investigation process, and solution
|
|
111
|
+
- Update troubleshooting guides
|
|
112
|
+
- Share learnings with the team
|
|
113
|
+
- Update code comments with context
|
|
114
|
+
|
|
115
|
+
18. **Post-Resolution Review**
|
|
116
|
+
- Analyze why the error wasn't caught earlier
|
|
117
|
+
- Review development and testing processes
|
|
118
|
+
- Consider improvements to prevent similar issues
|
|
119
|
+
- Update coding standards or guidelines if needed
|
|
120
|
+
|
|
121
|
+
Remember to maintain detailed notes throughout the debugging process and consider the wider implications of both the error and the fix.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Refactor Code Command
|
|
2
|
+
|
|
3
|
+
Safely improve code structure while preserving functionality.
|
|
4
|
+
|
|
5
|
+
## Core Principles
|
|
6
|
+
|
|
7
|
+
- **Test First**: Ensure tests exist and pass before starting
|
|
8
|
+
- **Small Steps**: Make incremental changes, test after each
|
|
9
|
+
- **Preserve Behavior**: External functionality must remain identical
|
|
10
|
+
|
|
11
|
+
## Refactoring Process
|
|
12
|
+
|
|
13
|
+
1. **Analyze** - Understand current code and identify improvement areas
|
|
14
|
+
2. **Test Coverage** - Verify/add tests before changing anything
|
|
15
|
+
3. **Plan** - Choose refactoring technique (extract method, rename, simplify conditionals)
|
|
16
|
+
4. **Execute** - Make one small change at a time, running tests after each
|
|
17
|
+
5. **Verify** - Ensure all tests pass and performance hasn't degraded
|
|
18
|
+
|
|
19
|
+
## Key Improvements
|
|
20
|
+
|
|
21
|
+
- **Clarity**: Better names, simpler logic, shorter methods
|
|
22
|
+
- **Structure**: Remove duplication, improve separation of concerns, improve cohesion
|
|
23
|
+
- **Maintainability**: Apply patterns where beneficial, standardize error handling
|
|
24
|
+
- **Documentation**: Update comments and docs to match changes
|
|
25
|
+
|
|
26
|
+
## Safety Checklist
|
|
27
|
+
|
|
28
|
+
- [ ] All tests passing before and after
|
|
29
|
+
- [ ] No functionality changes
|
|
30
|
+
- [ ] Code reviewed for quality
|
|
31
|
+
- [ ] Changes documented
|
|
32
|
+
|
|
33
|
+
Remember: Working code > perfect code. Commit frequently, refactor incrementally.
|
kodit-0.3.1/CLAUDE.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Kodit is a code indexing MCP (Model Context Protocol) server that connects AI coding assistants to external codebases. It provides semantic and keyword search capabilities over indexed code snippets to improve AI-assisted development.
|
|
8
|
+
|
|
9
|
+
## Development Commands
|
|
10
|
+
|
|
11
|
+
### Testing
|
|
12
|
+
|
|
13
|
+
- `uv run pytest src/kodit` - Run all unit tests with coverage
|
|
14
|
+
- `uv run pytest tests/path/to/test.py` - Run specific test file
|
|
15
|
+
- `uv run pytest -k "test_name"` - Run specific test by name
|
|
16
|
+
|
|
17
|
+
### Code Quality
|
|
18
|
+
|
|
19
|
+
- `uv run ruff check --fix` - Run linting
|
|
20
|
+
- `uv run ruff format` - Format code
|
|
21
|
+
- `uv run mypy src/` - Type checking
|
|
22
|
+
|
|
23
|
+
### Application
|
|
24
|
+
|
|
25
|
+
- `uv run kodit --help` - Show CLI help
|
|
26
|
+
- `uv run kodit index <path>` - Index a codebase
|
|
27
|
+
- `uv run kodit serve` - Start MCP server
|
|
28
|
+
|
|
29
|
+
### Database
|
|
30
|
+
|
|
31
|
+
- `uv run alembic upgrade head` - Apply database migrations
|
|
32
|
+
- `uv run alembic revision --autogenerate -m "description"` - Generate new migration
|
|
33
|
+
|
|
34
|
+
## Architecture
|
|
35
|
+
|
|
36
|
+
### Domain-Driven Design Structure
|
|
37
|
+
|
|
38
|
+
The codebase follows Domain-Driven Design (DDD) with clean architecture:
|
|
39
|
+
|
|
40
|
+
- `domain/` - Core business logic and interfaces
|
|
41
|
+
- `entities.py` - Domain entities (Snippet, File, etc.)
|
|
42
|
+
- `repositories.py` - Repository interfaces
|
|
43
|
+
- `services/` - Domain services for business logic
|
|
44
|
+
- `application/` - Application services and factories
|
|
45
|
+
- `infrastructure/` - External concerns and implementations
|
|
46
|
+
- `sqlalchemy/` - Database repositories
|
|
47
|
+
- `embedding/` - Vector embedding providers
|
|
48
|
+
- `bm25/` - BM25 search implementations
|
|
49
|
+
- `indexing/` - Code indexing services
|
|
50
|
+
|
|
51
|
+
### Key Components
|
|
52
|
+
|
|
53
|
+
**Indexing Pipeline:**
|
|
54
|
+
|
|
55
|
+
1. Clone/read source code
|
|
56
|
+
2. Extract snippets using Tree-sitter
|
|
57
|
+
3. Generate embeddings and BM25 indices
|
|
58
|
+
4. Store in database
|
|
59
|
+
|
|
60
|
+
**Search System:**
|
|
61
|
+
|
|
62
|
+
- Hybrid search combining semantic (embeddings) and keyword (BM25)
|
|
63
|
+
- Multiple providers: local models, OpenAI, custom APIs
|
|
64
|
+
- Configurable via environment variables
|
|
65
|
+
|
|
66
|
+
**MCP Server:**
|
|
67
|
+
|
|
68
|
+
- FastMCP-based server exposing search tools
|
|
69
|
+
- Integrates with Cursor, Cline, and other AI assistants
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
Key environment variables:
|
|
74
|
+
|
|
75
|
+
- `KODIT_EMBEDDING_PROVIDER` - embedding provider (local/openai)
|
|
76
|
+
- `KODIT_DATABASE_URL` - database connection string
|
|
77
|
+
- `KODIT_OPENAI_API_KEY` - for OpenAI embeddings
|
|
78
|
+
- `KODIT_LOG_LEVEL` - logging level
|
|
79
|
+
|
|
80
|
+
See `config.py` for full configuration options.
|
|
81
|
+
|
|
82
|
+
## Database
|
|
83
|
+
|
|
84
|
+
Uses SQLAlchemy with async support. Supports:
|
|
85
|
+
|
|
86
|
+
- SQLite (default, local development)
|
|
87
|
+
- PostgreSQL with Vectorchord (production)
|
|
88
|
+
|
|
89
|
+
Migrations managed with Alembic in `migrations/` directory. DO NOT EDIT THESE FILES.
|
|
90
|
+
|
|
91
|
+
## Testing Strategy
|
|
92
|
+
|
|
93
|
+
- Unit tests for domain services and repositories
|
|
94
|
+
- Integration tests for database operations
|
|
95
|
+
- E2E tests for full indexing pipeline
|
|
96
|
+
- Smoke tests for deployment validation
|
|
97
|
+
- Performance tests for similarity search
|
|
98
|
+
|
|
99
|
+
Test files mirror source structure under `tests/` directory.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kodit
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
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/
|
|
@@ -83,7 +83,7 @@ If you're an engineer working with AI-powered coding assistants, Kodit helps by
|
|
|
83
83
|
providing relevant and up-to-date examples of your task so that LLMs make less mistakes
|
|
84
84
|
and produce fewer hallucinations.
|
|
85
85
|
|
|
86
|
-
##
|
|
86
|
+
## Features
|
|
87
87
|
|
|
88
88
|
### Codebase Indexing
|
|
89
89
|
|
|
@@ -94,7 +94,11 @@ code. This index is used to build a snippet library, ready for ingestion into an
|
|
|
94
94
|
- Build comprehensive snippet libraries for LLM ingestion
|
|
95
95
|
- Support for multiple codebase types and languages
|
|
96
96
|
- Efficient indexing and search capabilities
|
|
97
|
-
- Privacy first: respects .gitignore and .noindex files
|
|
97
|
+
- Privacy first: respects .gitignore and .noindex files
|
|
98
|
+
- **NEW in 0.3**: Auto-indexing configuration for shared server deployments
|
|
99
|
+
- **NEW in 0.3**: Enhanced Git provider support including Azure DevOps
|
|
100
|
+
- **NEW in 0.3**: Index private repositories via a PAT
|
|
101
|
+
- **NEW in 0.3**: Improved progress monitoring and reporting during indexing
|
|
98
102
|
|
|
99
103
|
### MCP Server
|
|
100
104
|
|
|
@@ -107,6 +111,7 @@ intent. Kodit has been tested to work well with:
|
|
|
107
111
|
- [Cursor](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cursor)
|
|
108
112
|
- [Cline](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cline)
|
|
109
113
|
- Please contribute more instructions! ... any other assistant is likely to work ...
|
|
114
|
+
- **New in 0.3**: Filter snippets by source, language, author or timestamp.
|
|
110
115
|
|
|
111
116
|
### Enterprise Ready
|
|
112
117
|
|
|
@@ -127,7 +132,12 @@ Supported providers:
|
|
|
127
132
|
- Secure, private LLM enclave with [Helix](https://helix.ml).
|
|
128
133
|
- Any other OpenAI compatible API
|
|
129
134
|
|
|
130
|
-
|
|
135
|
+
**NEW in 0.3**: Enhanced deployment options:
|
|
136
|
+
|
|
137
|
+
- Docker Compose configurations with VectorChord
|
|
138
|
+
- Kubernetes manifests for production deployments
|
|
139
|
+
|
|
140
|
+
## Quick Start
|
|
131
141
|
|
|
132
142
|
1. [Install Kodit](https://docs.helix.ml/kodit/getting-started/installation/)
|
|
133
143
|
2. [Index codebases](https://docs.helix.ml/kodit/getting-started/quick-start/)
|
|
@@ -30,7 +30,7 @@ If you're an engineer working with AI-powered coding assistants, Kodit helps by
|
|
|
30
30
|
providing relevant and up-to-date examples of your task so that LLMs make less mistakes
|
|
31
31
|
and produce fewer hallucinations.
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Features
|
|
34
34
|
|
|
35
35
|
### Codebase Indexing
|
|
36
36
|
|
|
@@ -41,7 +41,11 @@ code. This index is used to build a snippet library, ready for ingestion into an
|
|
|
41
41
|
- Build comprehensive snippet libraries for LLM ingestion
|
|
42
42
|
- Support for multiple codebase types and languages
|
|
43
43
|
- Efficient indexing and search capabilities
|
|
44
|
-
- Privacy first: respects .gitignore and .noindex files
|
|
44
|
+
- Privacy first: respects .gitignore and .noindex files
|
|
45
|
+
- **NEW in 0.3**: Auto-indexing configuration for shared server deployments
|
|
46
|
+
- **NEW in 0.3**: Enhanced Git provider support including Azure DevOps
|
|
47
|
+
- **NEW in 0.3**: Index private repositories via a PAT
|
|
48
|
+
- **NEW in 0.3**: Improved progress monitoring and reporting during indexing
|
|
45
49
|
|
|
46
50
|
### MCP Server
|
|
47
51
|
|
|
@@ -54,6 +58,7 @@ intent. Kodit has been tested to work well with:
|
|
|
54
58
|
- [Cursor](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cursor)
|
|
55
59
|
- [Cline](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cline)
|
|
56
60
|
- Please contribute more instructions! ... any other assistant is likely to work ...
|
|
61
|
+
- **New in 0.3**: Filter snippets by source, language, author or timestamp.
|
|
57
62
|
|
|
58
63
|
### Enterprise Ready
|
|
59
64
|
|
|
@@ -74,7 +79,12 @@ Supported providers:
|
|
|
74
79
|
- Secure, private LLM enclave with [Helix](https://helix.ml).
|
|
75
80
|
- Any other OpenAI compatible API
|
|
76
81
|
|
|
77
|
-
|
|
82
|
+
**NEW in 0.3**: Enhanced deployment options:
|
|
83
|
+
|
|
84
|
+
- Docker Compose configurations with VectorChord
|
|
85
|
+
- Kubernetes manifests for production deployments
|
|
86
|
+
|
|
87
|
+
## Quick Start
|
|
78
88
|
|
|
79
89
|
1. [Install Kodit](https://docs.helix.ml/kodit/getting-started/installation/)
|
|
80
90
|
2. [Index codebases](https://docs.helix.ml/kodit/getting-started/quick-start/)
|
|
@@ -40,7 +40,7 @@ If you're an engineer working with AI-powered coding assistants, Kodit helps by
|
|
|
40
40
|
providing relevant and up-to-date examples of your task so that LLMs make less mistakes
|
|
41
41
|
and produce fewer hallucinations.
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## Features
|
|
44
44
|
|
|
45
45
|
### Codebase Indexing
|
|
46
46
|
|
|
@@ -51,7 +51,11 @@ code. This index is used to build a snippet library, ready for ingestion into an
|
|
|
51
51
|
- Build comprehensive snippet libraries for LLM ingestion
|
|
52
52
|
- Support for multiple codebase types and languages
|
|
53
53
|
- Efficient indexing and search capabilities
|
|
54
|
-
- Privacy first: respects .gitignore and .noindex files
|
|
54
|
+
- Privacy first: respects .gitignore and .noindex files
|
|
55
|
+
- **NEW in 0.3**: Auto-indexing configuration for shared server deployments
|
|
56
|
+
- **NEW in 0.3**: Enhanced Git provider support including Azure DevOps
|
|
57
|
+
- **NEW in 0.3**: Index private repositories via a PAT
|
|
58
|
+
- **NEW in 0.3**: Improved progress monitoring and reporting during indexing
|
|
55
59
|
|
|
56
60
|
### MCP Server
|
|
57
61
|
|
|
@@ -64,6 +68,7 @@ intent. Kodit has been tested to work well with:
|
|
|
64
68
|
- [Cursor](./getting-started/integration/index.md#integration-with-cursor)
|
|
65
69
|
- [Cline](./getting-started/integration/index.md#integration-with-cline)
|
|
66
70
|
- Please contribute more instructions! ... any other assistant is likely to work ...
|
|
71
|
+
- **New in 0.3**: Filter snippets by source, language, author or timestamp.
|
|
67
72
|
|
|
68
73
|
### Enterprise Ready
|
|
69
74
|
|
|
@@ -84,6 +89,11 @@ Supported providers:
|
|
|
84
89
|
- Secure, private LLM enclave with [Helix](https://helix.ml).
|
|
85
90
|
- Any other OpenAI compatible API
|
|
86
91
|
|
|
92
|
+
**NEW in 0.3**: Enhanced deployment options:
|
|
93
|
+
|
|
94
|
+
- Docker Compose configurations with VectorChord
|
|
95
|
+
- Kubernetes manifests for production deployments
|
|
96
|
+
|
|
87
97
|
## Roadmap
|
|
88
98
|
|
|
89
99
|
The roadmap is currently maintained as a [Github Project](https://github.com/orgs/helixml/projects/4).
|
{kodit-0.3.0 → kodit-0.3.1}/src/kodit/application/services/code_indexing_application_service.py
RENAMED
|
@@ -27,7 +27,6 @@ from kodit.domain.value_objects import (
|
|
|
27
27
|
MultiSearchResult,
|
|
28
28
|
SearchRequest,
|
|
29
29
|
SearchResult,
|
|
30
|
-
SnippetListItem,
|
|
31
30
|
)
|
|
32
31
|
from kodit.log import log_event
|
|
33
32
|
from kodit.reporting import Reporter
|
|
@@ -225,17 +224,17 @@ class CodeIndexingApplicationService:
|
|
|
225
224
|
|
|
226
225
|
return [
|
|
227
226
|
MultiSearchResult(
|
|
228
|
-
id=snippet
|
|
229
|
-
uri=file
|
|
230
|
-
content=snippet
|
|
227
|
+
id=result.snippet.id,
|
|
228
|
+
uri=result.file.uri,
|
|
229
|
+
content=result.snippet.content,
|
|
231
230
|
original_scores=fr.original_scores,
|
|
232
231
|
)
|
|
233
|
-
for
|
|
232
|
+
for result, fr in zip(search_results, final_results, strict=True)
|
|
234
233
|
]
|
|
235
234
|
|
|
236
235
|
async def list_snippets(
|
|
237
236
|
self, file_path: str | None = None, source_uri: str | None = None
|
|
238
|
-
) -> list[
|
|
237
|
+
) -> list[MultiSearchResult]:
|
|
239
238
|
"""List snippets with optional filtering."""
|
|
240
239
|
log_event("kodit.index.list_snippets")
|
|
241
240
|
return await self.snippet_domain_service.list_snippets(file_path, source_uri)
|
|
@@ -260,12 +260,7 @@ async def code( # noqa: PLR0913
|
|
|
260
260
|
return
|
|
261
261
|
|
|
262
262
|
for snippet in snippets:
|
|
263
|
-
click.echo(
|
|
264
|
-
click.echo(f"{snippet.uri}")
|
|
265
|
-
click.echo(f"Original scores: {snippet.original_scores}")
|
|
266
|
-
click.echo(snippet.content)
|
|
267
|
-
click.echo("-" * 80)
|
|
268
|
-
click.echo()
|
|
263
|
+
click.echo(str(snippet))
|
|
269
264
|
|
|
270
265
|
|
|
271
266
|
@search.command()
|
|
@@ -322,12 +317,7 @@ async def keyword( # noqa: PLR0913
|
|
|
322
317
|
return
|
|
323
318
|
|
|
324
319
|
for snippet in snippets:
|
|
325
|
-
click.echo(
|
|
326
|
-
click.echo(f"{snippet.uri}")
|
|
327
|
-
click.echo(f"Original scores: {snippet.original_scores}")
|
|
328
|
-
click.echo(snippet.content)
|
|
329
|
-
click.echo("-" * 80)
|
|
330
|
-
click.echo()
|
|
320
|
+
click.echo(str(snippet))
|
|
331
321
|
|
|
332
322
|
|
|
333
323
|
@search.command()
|
|
@@ -387,12 +377,7 @@ async def text( # noqa: PLR0913
|
|
|
387
377
|
return
|
|
388
378
|
|
|
389
379
|
for snippet in snippets:
|
|
390
|
-
click.echo(
|
|
391
|
-
click.echo(f"{snippet.uri}")
|
|
392
|
-
click.echo(f"Original scores: {snippet.original_scores}")
|
|
393
|
-
click.echo(snippet.content)
|
|
394
|
-
click.echo("-" * 80)
|
|
395
|
-
click.echo()
|
|
380
|
+
click.echo(str(snippet))
|
|
396
381
|
|
|
397
382
|
|
|
398
383
|
@search.command()
|
|
@@ -462,12 +447,7 @@ async def hybrid( # noqa: PLR0913
|
|
|
462
447
|
return
|
|
463
448
|
|
|
464
449
|
for snippet in snippets:
|
|
465
|
-
click.echo(
|
|
466
|
-
click.echo(f"{snippet.uri}")
|
|
467
|
-
click.echo(f"Original scores: {snippet.original_scores}")
|
|
468
|
-
click.echo(snippet.content)
|
|
469
|
-
click.echo("-" * 80)
|
|
470
|
-
click.echo()
|
|
450
|
+
click.echo(str(snippet))
|
|
471
451
|
|
|
472
452
|
|
|
473
453
|
@cli.group()
|
|
@@ -499,9 +479,7 @@ async def snippets(
|
|
|
499
479
|
)
|
|
500
480
|
snippets = await service.list_snippets(file_path=by_path, source_uri=by_source)
|
|
501
481
|
for snippet in snippets:
|
|
502
|
-
click.echo(
|
|
503
|
-
click.echo(f" {snippet.content}")
|
|
504
|
-
click.echo()
|
|
482
|
+
click.echo(str(snippet))
|
|
505
483
|
|
|
506
484
|
|
|
507
485
|
@cli.command()
|
|
@@ -9,7 +9,12 @@ from typing import TYPE_CHECKING, Any, Literal, TypeVar
|
|
|
9
9
|
|
|
10
10
|
import click
|
|
11
11
|
from pydantic import BaseModel, Field, field_validator
|
|
12
|
-
from pydantic_settings import
|
|
12
|
+
from pydantic_settings import (
|
|
13
|
+
BaseSettings,
|
|
14
|
+
EnvSettingsSource,
|
|
15
|
+
PydanticBaseSettingsSource,
|
|
16
|
+
SettingsConfigDict,
|
|
17
|
+
)
|
|
13
18
|
|
|
14
19
|
if TYPE_CHECKING:
|
|
15
20
|
from collections.abc import Callable, Coroutine
|
|
@@ -57,7 +62,7 @@ class AutoIndexingConfig(BaseModel):
|
|
|
57
62
|
|
|
58
63
|
@field_validator("sources", mode="before")
|
|
59
64
|
@classmethod
|
|
60
|
-
def parse_sources(cls, v: Any) ->
|
|
65
|
+
def parse_sources(cls, v: Any) -> Any:
|
|
61
66
|
"""Parse sources from environment variables or other formats."""
|
|
62
67
|
if v is None:
|
|
63
68
|
return []
|
|
@@ -76,6 +81,36 @@ class AutoIndexingConfig(BaseModel):
|
|
|
76
81
|
return v
|
|
77
82
|
|
|
78
83
|
|
|
84
|
+
class CustomAutoIndexingEnvSource(EnvSettingsSource):
|
|
85
|
+
"""Custom environment source for parsing AutoIndexingConfig."""
|
|
86
|
+
|
|
87
|
+
def __call__(self) -> dict[str, Any]:
|
|
88
|
+
"""Load settings from env vars with custom auto-indexing parsing."""
|
|
89
|
+
d: dict[str, Any] = {}
|
|
90
|
+
|
|
91
|
+
# First get the standard env vars
|
|
92
|
+
env_vars = super().__call__()
|
|
93
|
+
d.update(env_vars)
|
|
94
|
+
|
|
95
|
+
# Custom parsing for auto-indexing sources
|
|
96
|
+
auto_indexing_sources = []
|
|
97
|
+
i = 0
|
|
98
|
+
while True:
|
|
99
|
+
# Note: env_vars keys are lowercase due to Pydantic Settings normalization
|
|
100
|
+
uri_key = f"auto_indexing_sources_{i}_uri"
|
|
101
|
+
if uri_key in self.env_vars:
|
|
102
|
+
uri_value = self.env_vars[uri_key]
|
|
103
|
+
auto_indexing_sources.append({"uri": uri_value})
|
|
104
|
+
i += 1
|
|
105
|
+
else:
|
|
106
|
+
break
|
|
107
|
+
|
|
108
|
+
if auto_indexing_sources:
|
|
109
|
+
d["auto_indexing"] = {"sources": auto_indexing_sources}
|
|
110
|
+
|
|
111
|
+
return d
|
|
112
|
+
|
|
113
|
+
|
|
79
114
|
class AppContext(BaseSettings):
|
|
80
115
|
"""Global context for the kodit project. Provides a shared state for the app."""
|
|
81
116
|
|
|
@@ -83,10 +118,35 @@ class AppContext(BaseSettings):
|
|
|
83
118
|
env_file=".env",
|
|
84
119
|
env_file_encoding="utf-8",
|
|
85
120
|
env_nested_delimiter="_",
|
|
121
|
+
env_nested_max_split=1,
|
|
86
122
|
nested_model_default_partial_update=True,
|
|
87
123
|
extra="ignore",
|
|
88
124
|
)
|
|
89
125
|
|
|
126
|
+
@classmethod
|
|
127
|
+
def settings_customise_sources(
|
|
128
|
+
cls,
|
|
129
|
+
settings_cls: type[BaseSettings],
|
|
130
|
+
init_settings: PydanticBaseSettingsSource,
|
|
131
|
+
env_settings: PydanticBaseSettingsSource, # noqa: ARG003
|
|
132
|
+
dotenv_settings: PydanticBaseSettingsSource,
|
|
133
|
+
file_secret_settings: PydanticBaseSettingsSource,
|
|
134
|
+
) -> tuple[PydanticBaseSettingsSource, ...]:
|
|
135
|
+
"""Customize settings sources to use custom auto-indexing parsing."""
|
|
136
|
+
custom_env_settings = CustomAutoIndexingEnvSource(
|
|
137
|
+
settings_cls,
|
|
138
|
+
env_nested_delimiter=settings_cls.model_config.get("env_nested_delimiter"),
|
|
139
|
+
env_ignore_empty=settings_cls.model_config.get("env_ignore_empty", False),
|
|
140
|
+
env_parse_none_str=settings_cls.model_config.get("env_parse_none_str", ""),
|
|
141
|
+
env_parse_enums=settings_cls.model_config.get("env_parse_enums", None),
|
|
142
|
+
)
|
|
143
|
+
return (
|
|
144
|
+
init_settings,
|
|
145
|
+
custom_env_settings,
|
|
146
|
+
dotenv_settings,
|
|
147
|
+
file_secret_settings,
|
|
148
|
+
)
|
|
149
|
+
|
|
90
150
|
data_dir: Path = Field(default=DEFAULT_BASE_DIR)
|
|
91
151
|
db_url: str = Field(default=DEFAULT_DB_URL)
|
|
92
152
|
log_level: str = Field(default=DEFAULT_LOG_LEVEL)
|
|
@@ -142,8 +202,6 @@ class AppContext(BaseSettings):
|
|
|
142
202
|
|
|
143
203
|
with_app_context = click.make_pass_decorator(AppContext)
|
|
144
204
|
|
|
145
|
-
T = TypeVar("T")
|
|
146
|
-
|
|
147
205
|
|
|
148
206
|
def wrap_async(f: Callable[..., Coroutine[Any, Any, T]]) -> Callable[..., T]:
|
|
149
207
|
"""Decorate async Click commands.
|
|
@@ -8,6 +8,7 @@ from kodit.domain.value_objects import (
|
|
|
8
8
|
FusionResult,
|
|
9
9
|
IndexCreateRequest,
|
|
10
10
|
IndexView,
|
|
11
|
+
SnippetWithFile,
|
|
11
12
|
)
|
|
12
13
|
|
|
13
14
|
|
|
@@ -51,7 +52,7 @@ class IndexRepository(ABC):
|
|
|
51
52
|
"""Update the content of an existing snippet."""
|
|
52
53
|
|
|
53
54
|
@abstractmethod
|
|
54
|
-
async def list_snippets_by_ids(self, ids: list[int]) -> list[
|
|
55
|
+
async def list_snippets_by_ids(self, ids: list[int]) -> list[SnippetWithFile]:
|
|
55
56
|
"""List snippets by IDs."""
|
|
56
57
|
|
|
57
58
|
|
|
@@ -190,14 +191,14 @@ class IndexingDomainService:
|
|
|
190
191
|
"""
|
|
191
192
|
return self.fusion_service.reciprocal_rank_fusion(rankings, k)
|
|
192
193
|
|
|
193
|
-
async def get_snippets_by_ids(self, ids: list[int]) -> list[
|
|
194
|
+
async def get_snippets_by_ids(self, ids: list[int]) -> list[SnippetWithFile]:
|
|
194
195
|
"""Get snippets by IDs.
|
|
195
196
|
|
|
196
197
|
Args:
|
|
197
198
|
ids: List of snippet IDs to retrieve.
|
|
198
199
|
|
|
199
200
|
Returns:
|
|
200
|
-
List of
|
|
201
|
+
List of SnippetWithFile objects containing file and snippet information.
|
|
201
202
|
|
|
202
203
|
"""
|
|
203
204
|
return await self.index_repository.list_snippets_by_ids(ids)
|
|
@@ -14,6 +14,7 @@ from kodit.domain.services.snippet_extraction_service import (
|
|
|
14
14
|
)
|
|
15
15
|
from kodit.domain.value_objects import (
|
|
16
16
|
MultiSearchRequest,
|
|
17
|
+
MultiSearchResult,
|
|
17
18
|
SnippetExtractionRequest,
|
|
18
19
|
SnippetListItem,
|
|
19
20
|
)
|
|
@@ -170,7 +171,7 @@ class SnippetDomainService:
|
|
|
170
171
|
|
|
171
172
|
async def list_snippets(
|
|
172
173
|
self, file_path: str | None = None, source_uri: str | None = None
|
|
173
|
-
) -> list[
|
|
174
|
+
) -> list[MultiSearchResult]:
|
|
174
175
|
"""List snippets with optional filtering.
|
|
175
176
|
|
|
176
177
|
Args:
|
|
@@ -178,10 +179,22 @@ class SnippetDomainService:
|
|
|
178
179
|
source_uri: Optional source URI to filter by
|
|
179
180
|
|
|
180
181
|
Returns:
|
|
181
|
-
List of
|
|
182
|
+
List of search results matching the criteria
|
|
182
183
|
|
|
183
184
|
"""
|
|
184
|
-
|
|
185
|
+
snippet_items = await self.snippet_repository.list_snippets(
|
|
186
|
+
file_path, source_uri
|
|
187
|
+
)
|
|
188
|
+
# Convert SnippetListItem to MultiSearchResult for unified display format
|
|
189
|
+
return [
|
|
190
|
+
MultiSearchResult(
|
|
191
|
+
id=item.id,
|
|
192
|
+
uri=item.source_uri,
|
|
193
|
+
content=item.content,
|
|
194
|
+
original_scores=[],
|
|
195
|
+
)
|
|
196
|
+
for item in snippet_items
|
|
197
|
+
]
|
|
185
198
|
|
|
186
199
|
def _should_process_file(self, file: Any) -> bool:
|
|
187
200
|
"""Check if a file should be processed for snippet extraction.
|