kodit 0.4.1__tar.gz → 0.4.3__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.4.1 → kodit-0.4.3}/.vscode/settings.json +3 -0
- {kodit-0.4.1 → kodit-0.4.3}/PKG-INFO +1 -1
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/api/index.md +68 -1
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/api/openapi.json +158 -1
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/_version.py +2 -2
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/app.py +9 -2
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/factories/code_indexing_factory.py +62 -13
- kodit-0.4.3/src/kodit/application/factories/reporting_factory.py +32 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/services/auto_indexing_service.py +41 -33
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/services/code_indexing_application_service.py +137 -138
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/services/indexing_worker_service.py +26 -30
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/services/queue_service.py +12 -14
- kodit-0.4.3/src/kodit/application/services/reporting.py +104 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/services/sync_scheduler.py +21 -20
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/cli.py +71 -85
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/config.py +26 -3
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/database.py +2 -1
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/entities.py +99 -1
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/protocols.py +34 -1
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/services/bm25_service.py +1 -6
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/services/index_service.py +23 -57
- kodit-0.4.3/src/kodit/domain/services/task_status_query_service.py +19 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/value_objects.py +53 -8
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/dependencies.py +40 -12
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/routers/indexes.py +45 -0
- kodit-0.4.3/src/kodit/infrastructure/api/v1/schemas/task_status.py +39 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/cloning/git/working_copy.py +43 -7
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/embedding_factory.py +8 -3
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/embedding_providers/litellm_embedding_provider.py +48 -55
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/enrichment/local_enrichment_provider.py +41 -30
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/git/git_utils.py +3 -2
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/mappers/index_mapper.py +1 -0
- kodit-0.4.3/src/kodit/infrastructure/mappers/task_status_mapper.py +85 -0
- kodit-0.4.3/src/kodit/infrastructure/reporting/__init__.py +1 -0
- kodit-0.4.3/src/kodit/infrastructure/reporting/db_progress.py +23 -0
- kodit-0.4.3/src/kodit/infrastructure/reporting/log_progress.py +37 -0
- kodit-0.4.3/src/kodit/infrastructure/reporting/tdqm_progress.py +38 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/sqlalchemy/embedding_repository.py +47 -68
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/sqlalchemy/entities.py +89 -2
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/sqlalchemy/index_repository.py +274 -236
- kodit-0.4.3/src/kodit/infrastructure/sqlalchemy/task_repository.py +97 -0
- kodit-0.4.3/src/kodit/infrastructure/sqlalchemy/task_status_repository.py +79 -0
- kodit-0.4.3/src/kodit/infrastructure/sqlalchemy/unit_of_work.py +59 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/mcp.py +15 -3
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/env.py +0 -1
- kodit-0.4.3/src/kodit/migrations/versions/b9cd1c3fd762_add_task_status.py +77 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/conftest.py +14 -1
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/code_indexing_application_service_test.py +9 -36
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/services/indexing_worker_service_test.py +7 -17
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/services/queue_service_get_task_test.py +12 -6
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/services/queue_service_test.py +22 -12
- kodit-0.4.3/tests/kodit/application/services/reporting_test.py +39 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/services/sync_scheduler_test.py +4 -4
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/cli_test.py +30 -15
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/cloning/git_cloning/working_copy_test.py +5 -5
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/embedding_factory_test.py +13 -3
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/embedding_provider/litellm_embedding_provider_test.py +27 -29
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/local_vector_search_repository_test.py +58 -54
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/test_embedding_integration.py +329 -297
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/test_litellm_socket_providers.py +4 -4
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/sqlalchemy/embedding_repository_test.py +76 -68
- kodit-0.4.3/tests/kodit/infrastructure/sqlalchemy/index_repository_test.py +1190 -0
- kodit-0.4.3/tests/kodit/infrastructure/sqlalchemy/task_repository_test.py +375 -0
- kodit-0.4.3/tests/kodit/infrastructure/sqlalchemy/test_status_repository.py +324 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/performance/similarity.py +52 -47
- {kodit-0.4.1 → kodit-0.4.3}/tests/smoke.sh +6 -1
- kodit-0.4.1/src/kodit/domain/interfaces.py +0 -27
- kodit-0.4.1/src/kodit/infrastructure/sqlalchemy/task_repository.py +0 -81
- kodit-0.4.1/src/kodit/infrastructure/ui/__init__.py +0 -1
- kodit-0.4.1/src/kodit/infrastructure/ui/progress.py +0 -170
- kodit-0.4.1/src/kodit/infrastructure/ui/spinner.py +0 -74
- kodit-0.4.1/src/kodit/reporting.py +0 -78
- {kodit-0.4.1 → kodit-0.4.3}/.claude/commands/debug.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.claude/commands/new-requirement.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.claude/commands/refactor.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.claude/commands/update-docs.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.claude/settings.json +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.cursor/rules/kodit.mdc +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.cursor/rules/style.mdc +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.dockerignore +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/CODE_OF_CONDUCT.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/CONTRIBUTING.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/dependabot.yml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/workflows/docker.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/workflows/docs.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/workflows/pull_request.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/workflows/pypi-test.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/workflows/pypi.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.github/workflows/test.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.gitignore +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.python-version +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/.vscode/launch.json +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/CLAUDE.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/Dockerfile +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/LICENSE +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/Makefile +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/README.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/alembic.ini +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/_index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/demos/_index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/demos/go-simple-microservice/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/demos/knock-knock-auth/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/developer/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/getting-started/_index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/getting-started/installation/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/getting-started/integration/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/getting-started/quick-start/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/_index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/api/templates/_content.md.j2 +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/api/templates/_example.md.j2 +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/api/templates/_object_schema.md.j2 +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/api/templates/_security_scheme.md.j2 +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/api/templates/api_doc_template.md.j2 +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/configuration/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/deployment/docker-compose.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/deployment/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/deployment/kubernetes.yaml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/hosted-kodit/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/indexing/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/mcp/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/sync/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/docs/reference/telemetry/index.md +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/pyproject.toml +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/.gitignore +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/factories/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/application/services/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/cli_utils.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/errors.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/services/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/services/embedding_service.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/services/enrichment_service.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/domain/services/index_query_service.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/client/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/client/base.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/client/exceptions.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/client/generated_endpoints.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/client/index_client.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/client/search_client.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/middleware/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/middleware/auth.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/routers/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/routers/queue.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/routers/search.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/schemas/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/schemas/context.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/schemas/index.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/schemas/queue.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/api/v1/schemas/search.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/bm25/bm25_factory.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/bm25/local_bm25_repository.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/bm25/vectorchord_bm25_repository.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/cloning/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/cloning/git/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/cloning/metadata.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/embedding_providers/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/embedding_providers/batching.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/embedding_providers/hash_embedding_provider.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/embedding_providers/local_embedding_provider.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/local_vector_search_repository.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/enrichment/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/enrichment/enrichment_factory.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/enrichment/litellm_enrichment_provider.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/enrichment/null_enrichment_provider.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/enrichment/utils.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/git/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/ignore/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/ignore/ignore_pattern_provider.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/indexing/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/indexing/fusion_service.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/mappers/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/mappers/task_mapper.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/slicing/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/slicing/language_detection_service.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/slicing/slicer.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/log.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/middleware.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/README +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/script.py.mako +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/4073b33f9436_add_file_processing_flag.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/4552eb3f23ce_add_summary.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/85155663351e_initial.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/9cf0e87de578_add_queue.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/9e53ea8bb3b0_add_authors.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/utils/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/utils/dump_openapi.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/utils/generate_api_paths.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/src/kodit/utils/path_utils.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/docker-smoke.sh +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/experiments/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/experiments/cline_prompt_tests/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/experiments/cline_prompt_tests/cline_prompt.txt +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/experiments/cline_prompt_tests/cline_prompt_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/app_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/services/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/application/services/auto_indexing_service_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/config_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/bm25_service_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/embedding_service_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/enrichment_service_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/entities_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/language_detection_service_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/services/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/services/index_service_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/domain/value_objects_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/e2e.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/bm25/local_bm25_repository_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/bm25/vectorchord_bm25_repository_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/cloning/git_cloning/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/batching_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/embedding_provider/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/embedding_provider/hash_embedding_provider_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/embedding_provider/local_embedding_provider_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/embedding/vectorchord_vector_search_repository_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/enrichment/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/enrichment/enrichment_factory_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/litellm_enrichment_provider_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/local_enrichment_provider_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/enrichment/enrichment_provider/null_enrichment_provider_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/enrichment/utils_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/mappers/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/mappers/index_mapper_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/c/main.c +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/c/models.c +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/c/models.h +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/c/utils.c +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/c/utils.h +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/cpp/main.cpp +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/cpp/models.cpp +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/cpp/models.hpp +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/cpp/utils.cpp +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/cpp/utils.hpp +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/csharp/Main.cs +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/csharp/Models.cs +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/csharp/Utils.cs +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/css/components.css +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/css/main.css +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/css/utilities.css +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/go/main.go +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/go/models.go +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/go/utils.go +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/html/components.html +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/html/forms.html +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/html/main.html +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/java/Main.java +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/java/Models.java +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/java/Utils.java +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/javascript/main.js +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/javascript/models.js +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/javascript/utils.js +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/python/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/python/main.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/python/models.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/python/utils.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/rust/main.rs +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/rust/models.rs +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/data/rust/utils.rs +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/slicing/slicer_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/snippets/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/snippets/csharp.cs +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/snippets/golang.go +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/snippets/javascript.js +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/snippets/knock_knock_server.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/snippets/python.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/snippets/typescript.tsx +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/log_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/kodit/mcp_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/performance/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/utils/__init__.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/utils/path_utils_test.py +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/tests/vectorchord-smoke.sh +0 -0
- {kodit-0.4.1 → kodit-0.4.3}/uv.lock +0 -0
|
@@ -25,4 +25,7 @@
|
|
|
25
25
|
"python.analysis.completeFunctionParens": true,
|
|
26
26
|
"python.analysis.inlayHints.functionReturnTypes": true,
|
|
27
27
|
"python.analysis.typeCheckingMode": "standard",
|
|
28
|
+
"cursorpyright.analysis.autoImportCompletions": true,
|
|
29
|
+
"cursorpyright.analysis.inlayHints.functionReturnTypes": true,
|
|
30
|
+
"cursorpyright.analysis.typeCheckingMode": "standard",
|
|
28
31
|
}
|
|
@@ -12,7 +12,7 @@ look at the [hosted version](https://kodit.helix.ml/docs).
|
|
|
12
12
|
This is the REST API for the Kodit server. Please refer to the
|
|
13
13
|
[Kodit documentation](https://docs.helix.ml/kodit/) for more information.
|
|
14
14
|
|
|
15
|
-
Current version: 0.3
|
|
15
|
+
Current version: 0.4.3
|
|
16
16
|
|
|
17
17
|
## Authentication
|
|
18
18
|
|
|
@@ -126,6 +126,32 @@ Delete an index.
|
|
|
126
126
|
|
|
127
127
|
- 404: Index not found
|
|
128
128
|
|
|
129
|
+
### GET /api/v1/indexes/{index_id}/status
|
|
130
|
+
|
|
131
|
+
Get the status of tasks for an index.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
#### Parameters
|
|
135
|
+
|
|
136
|
+
| Name | Type | Required | Description |
|
|
137
|
+
|------|------|----------|-------------|
|
|
138
|
+
| index_id | integer | True | |
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
#### Responses
|
|
142
|
+
|
|
143
|
+
- 200: Successful Response
|
|
144
|
+
|
|
145
|
+
[TaskStatusListResponse](#taskstatuslistresponse)
|
|
146
|
+
|
|
147
|
+
- 500: Internal server error
|
|
148
|
+
|
|
149
|
+
- 401: Unauthorized
|
|
150
|
+
|
|
151
|
+
- 422: Invalid request
|
|
152
|
+
|
|
153
|
+
- 404: Index not found
|
|
154
|
+
|
|
129
155
|
### GET /api/v1/queue
|
|
130
156
|
|
|
131
157
|
List all tasks in the queue.
|
|
@@ -453,6 +479,47 @@ JSON:API response for single task.
|
|
|
453
479
|
| data | | |
|
|
454
480
|
|
|
455
481
|
|
|
482
|
+
### TaskStatusAttributes
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
Task status attributes for JSON:API responses.
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
| Field | Type | Description |
|
|
489
|
+
|-------|------|-------------|
|
|
490
|
+
| step | string | Name of the task/operation |
|
|
491
|
+
| state | string | Current state of the task |
|
|
492
|
+
| progress | number | Progress percentage (0-100) |
|
|
493
|
+
| total | integer | Total number of items to process |
|
|
494
|
+
| current | integer | Current number of items processed |
|
|
495
|
+
| created_at | | Task start time |
|
|
496
|
+
| updated_at | | Last update time |
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
### TaskStatusData
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
Task status data for JSON:API responses.
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
| Field | Type | Description |
|
|
506
|
+
|-------|------|-------------|
|
|
507
|
+
| type | string | |
|
|
508
|
+
| id | string | |
|
|
509
|
+
| attributes | | |
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
### TaskStatusListResponse
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
JSON:API response for task status list.
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
| Field | Type | Description |
|
|
519
|
+
|-------|------|-------------|
|
|
520
|
+
| data | array | |
|
|
521
|
+
|
|
522
|
+
|
|
456
523
|
### TaskType
|
|
457
524
|
|
|
458
525
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "kodit API",
|
|
5
5
|
"description": "\nThis is the REST API for the Kodit server. Please refer to the\n[Kodit documentation](https://docs.helix.ml/kodit/) for more information.\n ",
|
|
6
|
-
"version": "0.3
|
|
6
|
+
"version": "0.4.3"
|
|
7
7
|
},
|
|
8
8
|
"paths": {
|
|
9
9
|
"/healthz": {
|
|
@@ -197,6 +197,56 @@
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
|
+
"/api/v1/indexes/{index_id}/status": {
|
|
201
|
+
"get": {
|
|
202
|
+
"tags": [
|
|
203
|
+
"indexes"
|
|
204
|
+
],
|
|
205
|
+
"summary": "Get Index Status",
|
|
206
|
+
"description": "Get the status of tasks for an index.",
|
|
207
|
+
"operationId": "get_index_status_api_v1_indexes__index_id__status_get",
|
|
208
|
+
"security": [
|
|
209
|
+
{
|
|
210
|
+
"Header (X-API-KEY)": []
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"parameters": [
|
|
214
|
+
{
|
|
215
|
+
"name": "index_id",
|
|
216
|
+
"in": "path",
|
|
217
|
+
"required": true,
|
|
218
|
+
"schema": {
|
|
219
|
+
"type": "integer",
|
|
220
|
+
"title": "Index Id"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"responses": {
|
|
225
|
+
"200": {
|
|
226
|
+
"description": "Successful Response",
|
|
227
|
+
"content": {
|
|
228
|
+
"application/json": {
|
|
229
|
+
"schema": {
|
|
230
|
+
"$ref": "#/components/schemas/TaskStatusListResponse"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"500": {
|
|
236
|
+
"description": "Internal server error"
|
|
237
|
+
},
|
|
238
|
+
"401": {
|
|
239
|
+
"description": "Unauthorized"
|
|
240
|
+
},
|
|
241
|
+
"422": {
|
|
242
|
+
"description": "Invalid request"
|
|
243
|
+
},
|
|
244
|
+
"404": {
|
|
245
|
+
"description": "Index not found"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
200
250
|
"/api/v1/queue": {
|
|
201
251
|
"get": {
|
|
202
252
|
"tags": [
|
|
@@ -900,6 +950,113 @@
|
|
|
900
950
|
"title": "TaskResponse",
|
|
901
951
|
"description": "JSON:API response for single task."
|
|
902
952
|
},
|
|
953
|
+
"TaskStatusAttributes": {
|
|
954
|
+
"properties": {
|
|
955
|
+
"step": {
|
|
956
|
+
"type": "string",
|
|
957
|
+
"title": "Step",
|
|
958
|
+
"description": "Name of the task/operation"
|
|
959
|
+
},
|
|
960
|
+
"state": {
|
|
961
|
+
"type": "string",
|
|
962
|
+
"title": "State",
|
|
963
|
+
"description": "Current state of the task"
|
|
964
|
+
},
|
|
965
|
+
"progress": {
|
|
966
|
+
"type": "number",
|
|
967
|
+
"maximum": 100.0,
|
|
968
|
+
"minimum": 0.0,
|
|
969
|
+
"title": "Progress",
|
|
970
|
+
"description": "Progress percentage (0-100)",
|
|
971
|
+
"default": 0.0
|
|
972
|
+
},
|
|
973
|
+
"total": {
|
|
974
|
+
"type": "integer",
|
|
975
|
+
"title": "Total",
|
|
976
|
+
"description": "Total number of items to process",
|
|
977
|
+
"default": 0
|
|
978
|
+
},
|
|
979
|
+
"current": {
|
|
980
|
+
"type": "integer",
|
|
981
|
+
"title": "Current",
|
|
982
|
+
"description": "Current number of items processed",
|
|
983
|
+
"default": 0
|
|
984
|
+
},
|
|
985
|
+
"created_at": {
|
|
986
|
+
"anyOf": [
|
|
987
|
+
{
|
|
988
|
+
"type": "string",
|
|
989
|
+
"format": "date-time"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"type": "null"
|
|
993
|
+
}
|
|
994
|
+
],
|
|
995
|
+
"title": "Created At",
|
|
996
|
+
"description": "Task start time"
|
|
997
|
+
},
|
|
998
|
+
"updated_at": {
|
|
999
|
+
"anyOf": [
|
|
1000
|
+
{
|
|
1001
|
+
"type": "string",
|
|
1002
|
+
"format": "date-time"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
"type": "null"
|
|
1006
|
+
}
|
|
1007
|
+
],
|
|
1008
|
+
"title": "Updated At",
|
|
1009
|
+
"description": "Last update time"
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
"type": "object",
|
|
1013
|
+
"required": [
|
|
1014
|
+
"step",
|
|
1015
|
+
"state"
|
|
1016
|
+
],
|
|
1017
|
+
"title": "TaskStatusAttributes",
|
|
1018
|
+
"description": "Task status attributes for JSON:API responses."
|
|
1019
|
+
},
|
|
1020
|
+
"TaskStatusData": {
|
|
1021
|
+
"properties": {
|
|
1022
|
+
"type": {
|
|
1023
|
+
"type": "string",
|
|
1024
|
+
"title": "Type",
|
|
1025
|
+
"default": "task_status"
|
|
1026
|
+
},
|
|
1027
|
+
"id": {
|
|
1028
|
+
"type": "string",
|
|
1029
|
+
"title": "Id"
|
|
1030
|
+
},
|
|
1031
|
+
"attributes": {
|
|
1032
|
+
"$ref": "#/components/schemas/TaskStatusAttributes"
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
"type": "object",
|
|
1036
|
+
"required": [
|
|
1037
|
+
"id",
|
|
1038
|
+
"attributes"
|
|
1039
|
+
],
|
|
1040
|
+
"title": "TaskStatusData",
|
|
1041
|
+
"description": "Task status data for JSON:API responses."
|
|
1042
|
+
},
|
|
1043
|
+
"TaskStatusListResponse": {
|
|
1044
|
+
"properties": {
|
|
1045
|
+
"data": {
|
|
1046
|
+
"items": {
|
|
1047
|
+
"$ref": "#/components/schemas/TaskStatusData"
|
|
1048
|
+
},
|
|
1049
|
+
"type": "array",
|
|
1050
|
+
"title": "Data"
|
|
1051
|
+
}
|
|
1052
|
+
},
|
|
1053
|
+
"type": "object",
|
|
1054
|
+
"required": [
|
|
1055
|
+
"data"
|
|
1056
|
+
],
|
|
1057
|
+
"title": "TaskStatusListResponse",
|
|
1058
|
+
"description": "JSON:API response for task status list."
|
|
1059
|
+
},
|
|
903
1060
|
"TaskType": {
|
|
904
1061
|
"type": "integer",
|
|
905
1062
|
"enum": [
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.4.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 4,
|
|
31
|
+
__version__ = version = '0.4.3'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 4, 3)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -8,6 +8,7 @@ from fastapi import FastAPI, Response
|
|
|
8
8
|
from fastapi.responses import RedirectResponse
|
|
9
9
|
|
|
10
10
|
from kodit._version import version
|
|
11
|
+
from kodit.application.factories.reporting_factory import create_server_operation
|
|
11
12
|
from kodit.application.services.auto_indexing_service import AutoIndexingService
|
|
12
13
|
from kodit.application.services.indexing_worker_service import IndexingWorkerService
|
|
13
14
|
from kodit.application.services.sync_scheduler import SyncSchedulerService
|
|
@@ -18,6 +19,9 @@ from kodit.infrastructure.api.v1.routers import (
|
|
|
18
19
|
search_router,
|
|
19
20
|
)
|
|
20
21
|
from kodit.infrastructure.api.v1.schemas.context import AppLifespanState
|
|
22
|
+
from kodit.infrastructure.sqlalchemy.task_status_repository import (
|
|
23
|
+
create_task_status_repository,
|
|
24
|
+
)
|
|
21
25
|
from kodit.mcp import mcp
|
|
22
26
|
from kodit.middleware import ASGICancelledErrorMiddleware, logging_middleware
|
|
23
27
|
|
|
@@ -34,20 +38,23 @@ async def app_lifespan(_: FastAPI) -> AsyncIterator[AppLifespanState]:
|
|
|
34
38
|
# App context has already been configured by the CLI.
|
|
35
39
|
app_context = AppContext()
|
|
36
40
|
db = await app_context.get_db()
|
|
41
|
+
operation = create_server_operation(
|
|
42
|
+
create_task_status_repository(db.session_factory)
|
|
43
|
+
)
|
|
37
44
|
|
|
38
45
|
# Start the queue worker service
|
|
39
46
|
_indexing_worker_service = IndexingWorkerService(
|
|
40
47
|
app_context=app_context,
|
|
41
48
|
session_factory=db.session_factory,
|
|
42
49
|
)
|
|
43
|
-
await _indexing_worker_service.start()
|
|
50
|
+
await _indexing_worker_service.start(operation)
|
|
44
51
|
|
|
45
52
|
# Start auto-indexing service
|
|
46
53
|
_auto_indexing_service = AutoIndexingService(
|
|
47
54
|
app_context=app_context,
|
|
48
55
|
session_factory=db.session_factory,
|
|
49
56
|
)
|
|
50
|
-
await _auto_indexing_service.start_background_indexing()
|
|
57
|
+
await _auto_indexing_service.start_background_indexing(operation)
|
|
51
58
|
|
|
52
59
|
# Start sync scheduler service
|
|
53
60
|
if app_context.periodic_sync.enabled:
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"""Factory for creating the unified code indexing application service."""
|
|
2
2
|
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
|
|
3
5
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
4
6
|
|
|
7
|
+
from kodit.application.factories.reporting_factory import (
|
|
8
|
+
create_cli_operation,
|
|
9
|
+
create_noop_operation,
|
|
10
|
+
create_server_operation,
|
|
11
|
+
)
|
|
5
12
|
from kodit.application.services.code_indexing_application_service import (
|
|
6
13
|
CodeIndexingApplicationService,
|
|
7
14
|
)
|
|
15
|
+
from kodit.application.services.reporting import (
|
|
16
|
+
ProgressTracker,
|
|
17
|
+
)
|
|
8
18
|
from kodit.config import AppContext
|
|
9
19
|
from kodit.domain.services.bm25_service import BM25DomainService
|
|
10
20
|
from kodit.domain.services.embedding_service import EmbeddingDomainService
|
|
@@ -35,23 +45,35 @@ from kodit.infrastructure.slicing.language_detection_service import (
|
|
|
35
45
|
FileSystemLanguageDetectionService,
|
|
36
46
|
)
|
|
37
47
|
from kodit.infrastructure.sqlalchemy.embedding_repository import (
|
|
38
|
-
|
|
48
|
+
create_embedding_repository,
|
|
39
49
|
)
|
|
40
50
|
from kodit.infrastructure.sqlalchemy.entities import EmbeddingType
|
|
41
|
-
from kodit.infrastructure.sqlalchemy.index_repository import
|
|
51
|
+
from kodit.infrastructure.sqlalchemy.index_repository import (
|
|
52
|
+
create_index_repository,
|
|
53
|
+
)
|
|
54
|
+
from kodit.infrastructure.sqlalchemy.task_status_repository import (
|
|
55
|
+
create_task_status_repository,
|
|
56
|
+
)
|
|
42
57
|
|
|
43
58
|
|
|
44
59
|
def create_code_indexing_application_service(
|
|
45
60
|
app_context: AppContext,
|
|
46
|
-
|
|
61
|
+
session_factory: Callable[[], AsyncSession],
|
|
62
|
+
operation: ProgressTracker,
|
|
47
63
|
) -> CodeIndexingApplicationService:
|
|
48
64
|
"""Create a unified code indexing application service with all dependencies."""
|
|
49
65
|
# Create domain services
|
|
50
|
-
bm25_service = BM25DomainService(
|
|
51
|
-
|
|
52
|
-
|
|
66
|
+
bm25_service = BM25DomainService(
|
|
67
|
+
bm25_repository_factory(app_context, session_factory())
|
|
68
|
+
)
|
|
69
|
+
code_search_service = embedding_domain_service_factory(
|
|
70
|
+
"code", app_context, session_factory(), session_factory
|
|
71
|
+
)
|
|
72
|
+
text_search_service = embedding_domain_service_factory(
|
|
73
|
+
"text", app_context, session_factory(), session_factory
|
|
74
|
+
)
|
|
53
75
|
enrichment_service = enrichment_domain_service_factory(app_context)
|
|
54
|
-
index_repository =
|
|
76
|
+
index_repository = create_index_repository(session_factory=session_factory)
|
|
55
77
|
# Use the unified language mapping from the domain layer
|
|
56
78
|
language_map = LanguageMapping.get_extension_to_language_map()
|
|
57
79
|
|
|
@@ -77,18 +99,45 @@ def create_code_indexing_application_service(
|
|
|
77
99
|
code_search_service=code_search_service,
|
|
78
100
|
text_search_service=text_search_service,
|
|
79
101
|
enrichment_service=enrichment_service,
|
|
80
|
-
|
|
102
|
+
operation=operation,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def create_cli_code_indexing_application_service(
|
|
107
|
+
app_context: AppContext,
|
|
108
|
+
session_factory: Callable[[], AsyncSession],
|
|
109
|
+
) -> CodeIndexingApplicationService:
|
|
110
|
+
"""Create a CLI code indexing application service."""
|
|
111
|
+
return create_code_indexing_application_service(
|
|
112
|
+
app_context,
|
|
113
|
+
session_factory,
|
|
114
|
+
create_cli_operation(),
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def create_server_code_indexing_application_service(
|
|
119
|
+
app_context: AppContext,
|
|
120
|
+
session_factory: Callable[[], AsyncSession],
|
|
121
|
+
) -> CodeIndexingApplicationService:
|
|
122
|
+
"""Create a server code indexing application service."""
|
|
123
|
+
return create_code_indexing_application_service(
|
|
124
|
+
app_context,
|
|
125
|
+
session_factory,
|
|
126
|
+
create_server_operation(create_task_status_repository(session_factory)),
|
|
81
127
|
)
|
|
82
128
|
|
|
83
129
|
|
|
84
130
|
def create_fast_test_code_indexing_application_service(
|
|
85
131
|
app_context: AppContext,
|
|
86
|
-
|
|
132
|
+
session_factory: Callable[[], AsyncSession],
|
|
87
133
|
) -> CodeIndexingApplicationService:
|
|
88
134
|
"""Create a fast test code indexing application service."""
|
|
89
135
|
# Create domain services
|
|
90
|
-
bm25_service = BM25DomainService(
|
|
91
|
-
|
|
136
|
+
bm25_service = BM25DomainService(
|
|
137
|
+
bm25_repository_factory(app_context, session_factory())
|
|
138
|
+
)
|
|
139
|
+
embedding_repository = create_embedding_repository(session_factory=session_factory)
|
|
140
|
+
operation = create_noop_operation()
|
|
92
141
|
|
|
93
142
|
code_search_repository = LocalVectorSearchRepository(
|
|
94
143
|
embedding_repository=embedding_repository,
|
|
@@ -116,7 +165,7 @@ def create_fast_test_code_indexing_application_service(
|
|
|
116
165
|
enrichment_provider=NullEnrichmentProvider()
|
|
117
166
|
)
|
|
118
167
|
|
|
119
|
-
index_repository =
|
|
168
|
+
index_repository = create_index_repository(session_factory=session_factory)
|
|
120
169
|
# Use the unified language mapping from the domain layer
|
|
121
170
|
language_map = LanguageMapping.get_extension_to_language_map()
|
|
122
171
|
|
|
@@ -142,5 +191,5 @@ def create_fast_test_code_indexing_application_service(
|
|
|
142
191
|
code_search_service=code_search_service,
|
|
143
192
|
text_search_service=text_search_service,
|
|
144
193
|
enrichment_service=enrichment_service,
|
|
145
|
-
|
|
194
|
+
operation=operation,
|
|
146
195
|
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Reporting factory."""
|
|
2
|
+
|
|
3
|
+
from kodit.application.services.reporting import ProgressTracker, TaskOperation
|
|
4
|
+
from kodit.config import ReportingConfig
|
|
5
|
+
from kodit.domain.protocols import TaskStatusRepository
|
|
6
|
+
from kodit.infrastructure.reporting.db_progress import DBProgressReportingModule
|
|
7
|
+
from kodit.infrastructure.reporting.log_progress import LoggingReportingModule
|
|
8
|
+
from kodit.infrastructure.reporting.tdqm_progress import TQDMReportingModule
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def create_noop_operation() -> ProgressTracker:
|
|
12
|
+
"""Create a noop reporter."""
|
|
13
|
+
return ProgressTracker.create(TaskOperation.ROOT)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def create_cli_operation(config: ReportingConfig | None = None) -> ProgressTracker:
|
|
17
|
+
"""Create a CLI reporter."""
|
|
18
|
+
shared_config = config or ReportingConfig()
|
|
19
|
+
s = ProgressTracker.create(TaskOperation.ROOT)
|
|
20
|
+
s.subscribe(TQDMReportingModule(shared_config))
|
|
21
|
+
return s
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def create_server_operation(
|
|
25
|
+
task_status_repository: TaskStatusRepository, config: ReportingConfig | None = None
|
|
26
|
+
) -> ProgressTracker:
|
|
27
|
+
"""Create a server reporter."""
|
|
28
|
+
shared_config = config or ReportingConfig()
|
|
29
|
+
s = ProgressTracker.create(TaskOperation.ROOT)
|
|
30
|
+
s.subscribe(LoggingReportingModule(shared_config))
|
|
31
|
+
s.subscribe(DBProgressReportingModule(task_status_repository, shared_config))
|
|
32
|
+
return s
|
|
@@ -11,7 +11,9 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
11
11
|
from kodit.application.factories.code_indexing_factory import (
|
|
12
12
|
create_code_indexing_application_service,
|
|
13
13
|
)
|
|
14
|
+
from kodit.application.factories.reporting_factory import create_noop_operation
|
|
14
15
|
from kodit.application.services.queue_service import QueueService
|
|
16
|
+
from kodit.application.services.reporting import ProgressTracker
|
|
15
17
|
from kodit.config import AppContext
|
|
16
18
|
from kodit.domain.entities import Task
|
|
17
19
|
from kodit.domain.value_objects import QueuePriority
|
|
@@ -31,8 +33,11 @@ class AutoIndexingService:
|
|
|
31
33
|
self.log = structlog.get_logger(__name__)
|
|
32
34
|
self._indexing_task: asyncio.Task | None = None
|
|
33
35
|
|
|
34
|
-
async def start_background_indexing(
|
|
36
|
+
async def start_background_indexing(
|
|
37
|
+
self, operation: ProgressTracker | None = None
|
|
38
|
+
) -> None:
|
|
35
39
|
"""Start background indexing of configured sources."""
|
|
40
|
+
operation = operation or create_noop_operation()
|
|
36
41
|
if (
|
|
37
42
|
not self.app_context.auto_indexing
|
|
38
43
|
or len(self.app_context.auto_indexing.sources) == 0
|
|
@@ -48,40 +53,43 @@ class AutoIndexingService:
|
|
|
48
53
|
|
|
49
54
|
auto_sources = [source.uri for source in self.app_context.auto_indexing.sources]
|
|
50
55
|
self.log.info("Starting background indexing", num_sources=len(auto_sources))
|
|
51
|
-
self._indexing_task = asyncio.create_task(
|
|
56
|
+
self._indexing_task = asyncio.create_task(
|
|
57
|
+
self._index_sources(auto_sources, operation)
|
|
58
|
+
)
|
|
52
59
|
|
|
53
|
-
async def _index_sources(
|
|
60
|
+
async def _index_sources(
|
|
61
|
+
self, sources: list[str], operation: ProgressTracker | None = None
|
|
62
|
+
) -> None:
|
|
54
63
|
"""Index all configured sources in the background."""
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
# Continue with other sources even if one fails
|
|
64
|
+
operation = operation or create_noop_operation()
|
|
65
|
+
queue_service = QueueService(session_factory=self.session_factory)
|
|
66
|
+
service = create_code_indexing_application_service(
|
|
67
|
+
app_context=self.app_context,
|
|
68
|
+
session_factory=self.session_factory,
|
|
69
|
+
operation=operation,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
for source in sources:
|
|
73
|
+
try:
|
|
74
|
+
# Only auto-index a source if it is new
|
|
75
|
+
if await service.does_index_exist(source):
|
|
76
|
+
self.log.info("Index already exists, skipping", source=source)
|
|
77
|
+
continue
|
|
78
|
+
|
|
79
|
+
self.log.info("Adding auto-indexing task to queue", source=source)
|
|
80
|
+
|
|
81
|
+
# Create index
|
|
82
|
+
index = await service.create_index_from_uri(source)
|
|
83
|
+
|
|
84
|
+
await queue_service.enqueue_task(
|
|
85
|
+
Task.create_index_update_task(index.id, QueuePriority.BACKGROUND)
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
except Exception as exc:
|
|
89
|
+
self.log.exception(
|
|
90
|
+
"Failed to auto-index source", source=source, error=str(exc)
|
|
91
|
+
)
|
|
92
|
+
# Continue with other sources even if one fails
|
|
85
93
|
|
|
86
94
|
async def stop(self) -> None:
|
|
87
95
|
"""Stop background indexing."""
|