kodit 0.3.2__py3-none-any.whl → 0.3.3__py3-none-any.whl
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/_version.py +2 -2
- kodit/application/factories/code_indexing_factory.py +77 -28
- kodit/application/services/code_indexing_application_service.py +142 -116
- kodit/cli.py +14 -41
- kodit/domain/entities.py +268 -197
- kodit/domain/protocols.py +61 -0
- kodit/domain/services/embedding_service.py +1 -1
- kodit/domain/services/index_query_service.py +66 -0
- kodit/domain/services/index_service.py +323 -0
- kodit/domain/value_objects.py +150 -60
- kodit/infrastructure/cloning/git/working_copy.py +17 -8
- kodit/infrastructure/cloning/metadata.py +37 -67
- kodit/infrastructure/embedding/embedding_factory.py +1 -1
- kodit/infrastructure/embedding/local_vector_search_repository.py +1 -1
- kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +1 -1
- kodit/infrastructure/enrichment/null_enrichment_provider.py +4 -10
- kodit/infrastructure/git/git_utils.py +1 -63
- kodit/infrastructure/ignore/ignore_pattern_provider.py +1 -2
- kodit/infrastructure/indexing/auto_indexing_service.py +2 -12
- kodit/infrastructure/indexing/fusion_service.py +1 -1
- kodit/infrastructure/mappers/__init__.py +1 -0
- kodit/infrastructure/mappers/index_mapper.py +344 -0
- kodit/infrastructure/snippet_extraction/factories.py +13 -0
- kodit/infrastructure/snippet_extraction/language_detection_service.py +1 -1
- kodit/infrastructure/snippet_extraction/snippet_query_provider.py +0 -1
- kodit/infrastructure/snippet_extraction/tree_sitter_snippet_extractor.py +1 -1
- kodit/infrastructure/sqlalchemy/embedding_repository.py +1 -1
- kodit/infrastructure/sqlalchemy/entities.py +203 -0
- kodit/infrastructure/sqlalchemy/file_repository.py +1 -1
- kodit/infrastructure/sqlalchemy/index_repository.py +550 -0
- kodit/mcp.py +0 -7
- kodit/migrations/env.py +1 -1
- kodit/migrations/versions/4073b33f9436_add_file_processing_flag.py +34 -0
- kodit/utils/__init__.py +1 -0
- kodit/utils/path_utils.py +54 -0
- {kodit-0.3.2.dist-info → kodit-0.3.3.dist-info}/METADATA +1 -1
- {kodit-0.3.2.dist-info → kodit-0.3.3.dist-info}/RECORD +40 -44
- kodit/domain/enums.py +0 -9
- kodit/domain/repositories.py +0 -128
- kodit/domain/services/ignore_service.py +0 -45
- kodit/domain/services/indexing_service.py +0 -204
- kodit/domain/services/snippet_extraction_service.py +0 -89
- kodit/domain/services/snippet_service.py +0 -215
- kodit/domain/services/source_service.py +0 -85
- kodit/infrastructure/cloning/folder/__init__.py +0 -1
- kodit/infrastructure/cloning/folder/factory.py +0 -128
- kodit/infrastructure/cloning/folder/working_copy.py +0 -38
- kodit/infrastructure/cloning/git/factory.py +0 -153
- kodit/infrastructure/indexing/index_repository.py +0 -286
- kodit/infrastructure/indexing/snippet_domain_service_factory.py +0 -37
- kodit/infrastructure/sqlalchemy/repository.py +0 -133
- kodit/infrastructure/sqlalchemy/snippet_repository.py +0 -259
- {kodit-0.3.2.dist-info → kodit-0.3.3.dist-info}/WHEEL +0 -0
- {kodit-0.3.2.dist-info → kodit-0.3.3.dist-info}/entry_points.txt +0 -0
- {kodit-0.3.2.dist-info → kodit-0.3.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,52 +1,44 @@
|
|
|
1
1
|
kodit/.gitignore,sha256=ztkjgRwL9Uud1OEi36hGQeDGk3OLK1NfDEO8YqGYy8o,11
|
|
2
2
|
kodit/__init__.py,sha256=aEKHYninUq1yh6jaNfvJBYg-6fenpN132nJt1UU6Jxs,59
|
|
3
|
-
kodit/_version.py,sha256=
|
|
3
|
+
kodit/_version.py,sha256=cRYgYV4ttw-FMlrA4-5pzcSpTjS7X8uVa-nRTEADKW4,511
|
|
4
4
|
kodit/app.py,sha256=uv67TE83fZE7wrA7cz-sKosFrAXlKRr1B7fT-X_gMZQ,2103
|
|
5
|
-
kodit/cli.py,sha256=
|
|
5
|
+
kodit/cli.py,sha256=xh2MNA4sUTA3_yVbHGz-CRpbS0TTzKwf33XbScA74Gw,16626
|
|
6
6
|
kodit/config.py,sha256=VUoUi2t2yGhqOtm5MSZuaasNSklH50hfWn6GOrz3jnU,7518
|
|
7
7
|
kodit/database.py,sha256=kI9yBm4uunsgV4-QeVoCBL0wLzU4kYmYv5qZilGnbPE,1740
|
|
8
8
|
kodit/log.py,sha256=WOsLRitpCBtJa5IcsyZpKr146kXXHK2nU5VA90gcJdQ,8736
|
|
9
|
-
kodit/mcp.py,sha256=
|
|
9
|
+
kodit/mcp.py,sha256=OPscMbGQ05nFHJ_UkntobocZ6Y9wO2ZyRx1tVj7XSsY,6016
|
|
10
10
|
kodit/middleware.py,sha256=I6FOkqG9-8RH5kR1-0ZoQWfE4qLCB8lZYv8H_OCH29o,2714
|
|
11
11
|
kodit/reporting.py,sha256=icce1ZyiADsA_Qz-mSjgn2H4SSqKuGfLKnw-yrl9nsg,2722
|
|
12
12
|
kodit/application/__init__.py,sha256=mH50wTpgP9dhbKztFsL8Dda9Hi18TSnMVxXtpp4aGOA,35
|
|
13
13
|
kodit/application/factories/__init__.py,sha256=bU5CvEnaBePZ7JbkCOp1MGTNP752bnU2uEqmfy5FdRk,37
|
|
14
|
-
kodit/application/factories/code_indexing_factory.py,sha256=
|
|
14
|
+
kodit/application/factories/code_indexing_factory.py,sha256=VV-die0zKogN73ldLJtghI9CVtv77TAlgLOVARscWmk,6764
|
|
15
15
|
kodit/application/services/__init__.py,sha256=p5UQNw-H5sxQvs5Etfte93B3cJ1kKW6DNxK34uFvU1E,38
|
|
16
|
-
kodit/application/services/code_indexing_application_service.py,sha256=
|
|
16
|
+
kodit/application/services/code_indexing_application_service.py,sha256=xykcpLBS-5hZrFca2vakuVqdlZ4sbj26FLaViFC3N5c,14247
|
|
17
17
|
kodit/domain/__init__.py,sha256=TCpg4Xx-oF4mKV91lo4iXqMEfBT1OoRSYnbG-zVWolA,66
|
|
18
|
-
kodit/domain/entities.py,sha256=
|
|
19
|
-
kodit/domain/enums.py,sha256=Ik_h3D3eZ0FsSlPsU0ikm-Yv3Rmvzicffi9yBn19UIE,191
|
|
18
|
+
kodit/domain/entities.py,sha256=Mcku1Wmk3Xl3YJhY65_RoiLeffOLKOHI0uCAXWJrmvQ,8698
|
|
20
19
|
kodit/domain/errors.py,sha256=yIsgCjM_yOFIg8l7l-t7jM8pgeAX4cfPq0owf7iz3DA,106
|
|
21
20
|
kodit/domain/interfaces.py,sha256=Jkd0Ob4qSvhZHI9jRPFQ1n5Cv0SvU-y3Z-HCw2ikc4I,742
|
|
22
|
-
kodit/domain/
|
|
23
|
-
kodit/domain/value_objects.py,sha256=
|
|
21
|
+
kodit/domain/protocols.py,sha256=L94FwChhCoj39xicaVrK2UFhFbPzi5JEXW_KmgODsLA,1859
|
|
22
|
+
kodit/domain/value_objects.py,sha256=lNmbz9m39bP62lYvo6mQa-XzeYiQ7uFIZt-E6LUj0L4,17679
|
|
24
23
|
kodit/domain/services/__init__.py,sha256=Q1GhCK_PqKHYwYE4tkwDz5BIyXkJngLBBOHhzvX8nzo,42
|
|
25
24
|
kodit/domain/services/bm25_service.py,sha256=nsfTan3XtDwXuuAu1LUv-6Jukm6qFKVqqCVymjyepZQ,3625
|
|
26
|
-
kodit/domain/services/embedding_service.py,sha256=
|
|
25
|
+
kodit/domain/services/embedding_service.py,sha256=7drYRC2kjg0WJmo06a2E9N0vDnwInUlBB96twjz2BT8,4526
|
|
27
26
|
kodit/domain/services/enrichment_service.py,sha256=XsXg3nV-KN4rqtC7Zro_ZiZ6RSq-1eA1MG6IDzFGyBA,1316
|
|
28
|
-
kodit/domain/services/
|
|
29
|
-
kodit/domain/services/
|
|
30
|
-
kodit/domain/services/snippet_extraction_service.py,sha256=QW_99bXWpr8g6ZI-hp4Aj57VCSrUf71dLwQca5T6pyg,3065
|
|
31
|
-
kodit/domain/services/snippet_service.py,sha256=EyJQoT9UkJdMM2yfC1cFlj0yZVxK5a7NzleeM8lqWR0,7355
|
|
32
|
-
kodit/domain/services/source_service.py,sha256=9XGS3imJn65v855cztsJSaaFod6LhkF2xfUVMaytx-A,3068
|
|
27
|
+
kodit/domain/services/index_query_service.py,sha256=02UWfyB_HoHUskunGuHeq5XwQLSWxGSK4OhvxcqIfY0,2022
|
|
28
|
+
kodit/domain/services/index_service.py,sha256=lsHkiRJfJbBVuMMzM5TG6Z6EiT42RDwlXGKKHBLo8B4,12533
|
|
33
29
|
kodit/infrastructure/__init__.py,sha256=HzEYIjoXnkz_i_MHO2e0sIVYweUcRnl2RpyBiTbMObU,28
|
|
34
30
|
kodit/infrastructure/bm25/__init__.py,sha256=DmGbrEO34FOJy4e685BbyxLA7gPW1eqs2gAxsp6JOuM,34
|
|
35
31
|
kodit/infrastructure/bm25/bm25_factory.py,sha256=I4eo7qRslnyXIRkBf-StZ5ga2Evrr5J5YFocTChFD3g,884
|
|
36
32
|
kodit/infrastructure/bm25/local_bm25_repository.py,sha256=B1ggfHdjC9sFIh62MmSul2tsutWsWFQx5S1Xn07X_I8,4531
|
|
37
33
|
kodit/infrastructure/bm25/vectorchord_bm25_repository.py,sha256=Jyic55V-38XeTad462Ge751iKyc0X8RNVBM9pr_DVJk,7439
|
|
38
34
|
kodit/infrastructure/cloning/__init__.py,sha256=IzIvX-yeRRFZ-lfvPVSEe_qXszO6DGQdjKwwDigexyQ,30
|
|
39
|
-
kodit/infrastructure/cloning/metadata.py,sha256=
|
|
40
|
-
kodit/infrastructure/cloning/folder/__init__.py,sha256=w6ykrVtbYJlUDEXAjqgf6w2rMsUMCrrpIbl3QMjubgY,37
|
|
41
|
-
kodit/infrastructure/cloning/folder/factory.py,sha256=vl1hwnYA7lczjotn2fahJQAt7IK96CSArx8cSaRFKeY,4242
|
|
42
|
-
kodit/infrastructure/cloning/folder/working_copy.py,sha256=FPhwzuPj40yGoYvwcm9VG8mv8MbJxwfby_N5JS-_daA,1154
|
|
35
|
+
kodit/infrastructure/cloning/metadata.py,sha256=GD2UnCC1oR82RD0SVUqk9CJOqzXPxhOAHVOp7jqN6Qc,3571
|
|
43
36
|
kodit/infrastructure/cloning/git/__init__.py,sha256=20ePcp0qE6BuLsjsv4KYB1DzKhMIMsPXwEqIEZtjTJs,34
|
|
44
|
-
kodit/infrastructure/cloning/git/
|
|
45
|
-
kodit/infrastructure/cloning/git/working_copy.py,sha256=IwXQ0Ta59ykVkrxAyhJk0ijOO6aaub7UI-bXFDyNT0k,1562
|
|
37
|
+
kodit/infrastructure/cloning/git/working_copy.py,sha256=SvaLAJa7FRsLuWjJz-xUeTJ-EkpPi_rIOP-gyuHLIdM,1835
|
|
46
38
|
kodit/infrastructure/embedding/__init__.py,sha256=F-8nLlWAerYJ0MOIA4tbXHLan8bW5rRR84vzxx6tRKI,39
|
|
47
|
-
kodit/infrastructure/embedding/embedding_factory.py,sha256=
|
|
48
|
-
kodit/infrastructure/embedding/local_vector_search_repository.py,sha256=
|
|
49
|
-
kodit/infrastructure/embedding/vectorchord_vector_search_repository.py,sha256=
|
|
39
|
+
kodit/infrastructure/embedding/embedding_factory.py,sha256=A6if4XW7Kp-23qrWlLLNyhijwxZLxmhcyCX-ayvQKY4,3451
|
|
40
|
+
kodit/infrastructure/embedding/local_vector_search_repository.py,sha256=ExweyNEL5cP-g3eDhGqZSih7zhdOrop2WdFPPJL-tB4,3505
|
|
41
|
+
kodit/infrastructure/embedding/vectorchord_vector_search_repository.py,sha256=PIoU0HsDlaoXDXnGjOR0LAkAcW4JiE3ymJy_SBhEopc,8030
|
|
50
42
|
kodit/infrastructure/embedding/embedding_providers/__init__.py,sha256=qeZ-oAIAxMl5QqebGtO1lq-tHjl_ucAwOXePklcwwGk,34
|
|
51
43
|
kodit/infrastructure/embedding/embedding_providers/batching.py,sha256=a8CL9PX2VLmbeg616fc_lQzfC4BWTVn32m4SEhXpHxc,3279
|
|
52
44
|
kodit/infrastructure/embedding/embedding_providers/hash_embedding_provider.py,sha256=V6OdCuWyQQOvo3OJGRi-gBKDApIcrELydFg7T696P5s,2257
|
|
@@ -55,23 +47,24 @@ kodit/infrastructure/embedding/embedding_providers/openai_embedding_provider.py,
|
|
|
55
47
|
kodit/infrastructure/enrichment/__init__.py,sha256=8acZKNzql8Fs0lceFu9U3KoUrOptRBtVIxr_Iw6lz3Y,40
|
|
56
48
|
kodit/infrastructure/enrichment/enrichment_factory.py,sha256=Pz0Rb1I68udL_zXY3KvJ3LR3aK_9mdF1nMRGQUu4lM0,1828
|
|
57
49
|
kodit/infrastructure/enrichment/local_enrichment_provider.py,sha256=8CATNtgMHgBRt24GrYEwaZKrroNCxMJS-39xQJoG3N0,3818
|
|
58
|
-
kodit/infrastructure/enrichment/null_enrichment_provider.py,sha256=
|
|
50
|
+
kodit/infrastructure/enrichment/null_enrichment_provider.py,sha256=DhZkJBnkvXg_XSAs-oKiFnKqYFPnmTl3ikdxrqeEfbc,713
|
|
59
51
|
kodit/infrastructure/enrichment/openai_enrichment_provider.py,sha256=fenq4HiJ2UkrzsE2D0A0qpmro38z9mKaIzKKU5v7hnY,3189
|
|
60
52
|
kodit/infrastructure/git/__init__.py,sha256=0iMosFzudj4_xNIMe2SRbV6l5bWqkjnUsZoFsoZFuM8,33
|
|
61
|
-
kodit/infrastructure/git/git_utils.py,sha256=
|
|
53
|
+
kodit/infrastructure/git/git_utils.py,sha256=KERwmhWDR4ooMQKS-nSPxjvdCzoWF9NS6nhdeXyzdtY,571
|
|
62
54
|
kodit/infrastructure/ignore/__init__.py,sha256=VzFv8XOzHmsu0MEGnWVSF6KsgqLBmvHlRqAkT1Xb1MY,36
|
|
63
|
-
kodit/infrastructure/ignore/ignore_pattern_provider.py,sha256=
|
|
55
|
+
kodit/infrastructure/ignore/ignore_pattern_provider.py,sha256=zdxun3GodLfXxyssBK8QDUK58xb4fBJ0SKcHUyn3pzM,2131
|
|
64
56
|
kodit/infrastructure/indexing/__init__.py,sha256=7UPRa2jwCAsa0Orsp6PqXSF8iIXJVzXHMFmrKkI9yH8,38
|
|
65
|
-
kodit/infrastructure/indexing/auto_indexing_service.py,sha256=
|
|
66
|
-
kodit/infrastructure/indexing/fusion_service.py,sha256=
|
|
67
|
-
kodit/infrastructure/indexing/index_repository.py,sha256=4m_kFHQ3OSQdf2pgR1RM72g-k4UZHyHbtYKUwJ8huRs,8719
|
|
57
|
+
kodit/infrastructure/indexing/auto_indexing_service.py,sha256=PgAyrmR8jNkAOlGnhQjFkqoE22oh-IwYTCg_v4o45Fo,2764
|
|
58
|
+
kodit/infrastructure/indexing/fusion_service.py,sha256=2B0guBsuKz19uWcs18sIJpUJPzXoRvULgl7UNWQGysA,1809
|
|
68
59
|
kodit/infrastructure/indexing/indexing_factory.py,sha256=LPjPCps_wJ9M_fZGRP02bfc2pvYc50ZSTYI99XwRRPg,918
|
|
69
|
-
kodit/infrastructure/
|
|
60
|
+
kodit/infrastructure/mappers/__init__.py,sha256=QPHOjNreXmBPPovZ6elnYFS0vD-IsmrGl4TT01FCKro,77
|
|
61
|
+
kodit/infrastructure/mappers/index_mapper.py,sha256=ZSfu8kjTaa8_UY0nTqr4b02NS3VrjqZYkduCN71AL2g,12743
|
|
70
62
|
kodit/infrastructure/snippet_extraction/__init__.py,sha256=v6KqrRDjSj0nt87m7UwRGx2GN_fz_14VWq9Q0uABR_s,54
|
|
71
|
-
kodit/infrastructure/snippet_extraction/
|
|
63
|
+
kodit/infrastructure/snippet_extraction/factories.py,sha256=kAPd6JQyw7mVM4qfWqy9oD9pHGSatIlqfAxzZPzFBOw,407
|
|
64
|
+
kodit/infrastructure/snippet_extraction/language_detection_service.py,sha256=nOw3W8KkSAx2tDCitth7b6DXmxQeKj_4FGoaUp1fqWo,1145
|
|
72
65
|
kodit/infrastructure/snippet_extraction/snippet_extraction_factory.py,sha256=YA72kneJhR1nvgbYwH7fFAvTSMJw9bDoLGLhAAVpmq0,2272
|
|
73
|
-
kodit/infrastructure/snippet_extraction/snippet_query_provider.py,sha256=
|
|
74
|
-
kodit/infrastructure/snippet_extraction/tree_sitter_snippet_extractor.py,sha256=
|
|
66
|
+
kodit/infrastructure/snippet_extraction/snippet_query_provider.py,sha256=4bj4YtxmIC4r7TyU0QQYajmmDR1eIQKqWuJ6aZING2A,1283
|
|
67
|
+
kodit/infrastructure/snippet_extraction/tree_sitter_snippet_extractor.py,sha256=y2C5plTDvHOGTNdwcG4v_1Q15Pvq4mW7UlWsR3l5nCg,6177
|
|
75
68
|
kodit/infrastructure/snippet_extraction/languages/csharp.scm,sha256=gbBN4RiV1FBuTJF6orSnDFi8H9JwTw-d4piLJYsWUsc,222
|
|
76
69
|
kodit/infrastructure/snippet_extraction/languages/go.scm,sha256=SEX9mTOrhP2KiQW7oflDKkd21u5dK56QbJ4LvTDxY8A,533
|
|
77
70
|
kodit/infrastructure/snippet_extraction/languages/java.scm,sha256=kSEZT0QJAuhT7WpR2PklYiCX-03qRRpCAlcxfIbXPt4,227
|
|
@@ -79,25 +72,28 @@ kodit/infrastructure/snippet_extraction/languages/javascript.scm,sha256=Ini5TsVN
|
|
|
79
72
|
kodit/infrastructure/snippet_extraction/languages/python.scm,sha256=ee85R9PBzwye3IMTE7-iVoKWd_ViU3EJISTyrFGrVeo,429
|
|
80
73
|
kodit/infrastructure/snippet_extraction/languages/typescript.scm,sha256=U-ujbbv4tylbUBj9wuhL-e5cW6hmgPCNs4xrIX3r_hE,448
|
|
81
74
|
kodit/infrastructure/sqlalchemy/__init__.py,sha256=UXPMSF_hgWaqr86cawRVqM8XdVNumQyyK5B8B97GnlA,33
|
|
82
|
-
kodit/infrastructure/sqlalchemy/embedding_repository.py,sha256=
|
|
83
|
-
kodit/infrastructure/sqlalchemy/
|
|
84
|
-
kodit/infrastructure/sqlalchemy/
|
|
85
|
-
kodit/infrastructure/sqlalchemy/
|
|
75
|
+
kodit/infrastructure/sqlalchemy/embedding_repository.py,sha256=dC2Wzj_zQiWExwfScE1LAGiiyxPyg0YepwyLOgDwcs4,7905
|
|
76
|
+
kodit/infrastructure/sqlalchemy/entities.py,sha256=Dmh0z-dMI0wfMAPpf62kxU4md6NUH9P5Nx1QSTITOfg,5961
|
|
77
|
+
kodit/infrastructure/sqlalchemy/file_repository.py,sha256=1MBXh4ieE6W5LMcJl8V1YV0RUceH_PyiXPZ9IdA5_4g,2372
|
|
78
|
+
kodit/infrastructure/sqlalchemy/index_repository.py,sha256=vPK-gl3JqMGjK_vOyXCzR_P-sN_p-BpuXy0m_A7Nkpo,21524
|
|
86
79
|
kodit/infrastructure/ui/__init__.py,sha256=CzbLOBwIZ6B6iAHEd1L8cIBydCj-n_kobxJAhz2I9_Y,32
|
|
87
80
|
kodit/infrastructure/ui/progress.py,sha256=BaAeMEgXlSSb0c_t_NPxnThIktkzzCS9kegb5ExULJs,4791
|
|
88
81
|
kodit/infrastructure/ui/spinner.py,sha256=GcP115qtR0VEnGfMEtsGoAUpRzVGUSfiUXfoJJERngA,2357
|
|
89
82
|
kodit/migrations/README,sha256=ISVtAOvqvKk_5ThM5ioJE-lMkvf9IbknFUFVU_vPma4,58
|
|
90
83
|
kodit/migrations/__init__.py,sha256=lP5MuwlyWRMO6UcDWnQcQ3G-GYHcFb6rl9gYPHJ1sjo,40
|
|
91
|
-
kodit/migrations/env.py,sha256=
|
|
84
|
+
kodit/migrations/env.py,sha256=m57TkFLYjQ4w2aw1YICXkeek27M6qjwRDMHvThWqIL0,2383
|
|
92
85
|
kodit/migrations/script.py.mako,sha256=zWziKtiwYKEWuwPV_HBNHwa9LCT45_bi01-uSNFaOOE,703
|
|
86
|
+
kodit/migrations/versions/4073b33f9436_add_file_processing_flag.py,sha256=lntRkExB967OX0StZrcxEus9j2TmJvkwY5GO9ZNy7hM,903
|
|
93
87
|
kodit/migrations/versions/4552eb3f23ce_add_summary.py,sha256=_saoHs5HGzc_z2OzBkFKrifTLQfoNox3BpSBeiKg_f8,870
|
|
94
88
|
kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py,sha256=-61qol9PfQKILCDQRA5jEaats9aGZs9Wdtp-j-38SF4,1644
|
|
95
89
|
kodit/migrations/versions/85155663351e_initial.py,sha256=Cg7zlF871o9ShV5rQMQ1v7hRV7fI59veDY9cjtTrs-8,3306
|
|
96
90
|
kodit/migrations/versions/9e53ea8bb3b0_add_authors.py,sha256=a32Zm8KUQyiiLkjKNPYdaJDgjW6VsV-GhaLnPnK_fpI,3884
|
|
97
91
|
kodit/migrations/versions/__init__.py,sha256=9-lHzptItTzq_fomdIRBegQNm4Znx6pVjwD4MiqRIdo,36
|
|
98
92
|
kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py,sha256=rI8LmjF-I2OMxZ2nOIF_NRmqOLXe45hL_iz_nx97DTQ,1680
|
|
99
|
-
kodit
|
|
100
|
-
kodit
|
|
101
|
-
kodit-0.3.
|
|
102
|
-
kodit-0.3.
|
|
103
|
-
kodit-0.3.
|
|
93
|
+
kodit/utils/__init__.py,sha256=DPEB1i8evnLF4Ns3huuAYg-0pKBFKUFuiDzOKG9r-sw,33
|
|
94
|
+
kodit/utils/path_utils.py,sha256=thK6YGGNvQThdBaCYCCeCvS1L8x-lwl3AoGht2jnjGw,1645
|
|
95
|
+
kodit-0.3.3.dist-info/METADATA,sha256=nPUYBtjo5uMq6jYJSMGAdxNrNesYXsW8pQAixYUH0nw,6358
|
|
96
|
+
kodit-0.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
97
|
+
kodit-0.3.3.dist-info/entry_points.txt,sha256=hoTn-1aKyTItjnY91fnO-rV5uaWQLQ-Vi7V5et2IbHY,40
|
|
98
|
+
kodit-0.3.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
99
|
+
kodit-0.3.3.dist-info/RECORD,,
|
kodit/domain/enums.py
DELETED
kodit/domain/repositories.py
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"""Domain repositories with generic patterns."""
|
|
2
|
-
|
|
3
|
-
from collections.abc import Sequence
|
|
4
|
-
from typing import Protocol, TypeVar
|
|
5
|
-
|
|
6
|
-
from kodit.domain.entities import (
|
|
7
|
-
Author,
|
|
8
|
-
AuthorFileMapping,
|
|
9
|
-
File,
|
|
10
|
-
Snippet,
|
|
11
|
-
Source,
|
|
12
|
-
SourceType,
|
|
13
|
-
)
|
|
14
|
-
from kodit.domain.value_objects import (
|
|
15
|
-
MultiSearchRequest,
|
|
16
|
-
SnippetWithContext,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
T = TypeVar("T")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class GenericRepository(Protocol[T]):
|
|
23
|
-
"""Generic repository interface."""
|
|
24
|
-
|
|
25
|
-
async def get(self, id: int) -> T | None: # noqa: A002
|
|
26
|
-
"""Get entity by ID."""
|
|
27
|
-
...
|
|
28
|
-
|
|
29
|
-
async def save(self, entity: T) -> T:
|
|
30
|
-
"""Save entity."""
|
|
31
|
-
...
|
|
32
|
-
|
|
33
|
-
async def delete(self, id: int) -> None: # noqa: A002
|
|
34
|
-
"""Delete entity by ID."""
|
|
35
|
-
...
|
|
36
|
-
|
|
37
|
-
async def list(self) -> Sequence[T]:
|
|
38
|
-
"""List all entities."""
|
|
39
|
-
...
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class SourceRepository(GenericRepository[Source]):
|
|
43
|
-
"""Source repository with specific methods."""
|
|
44
|
-
|
|
45
|
-
async def get_by_uri(self, uri: str) -> Source | None:
|
|
46
|
-
"""Get a source by URI."""
|
|
47
|
-
raise NotImplementedError
|
|
48
|
-
|
|
49
|
-
async def list_by_type(
|
|
50
|
-
self, source_type: SourceType | None = None
|
|
51
|
-
) -> Sequence[Source]:
|
|
52
|
-
"""List sources by type."""
|
|
53
|
-
raise NotImplementedError
|
|
54
|
-
|
|
55
|
-
async def create_file(self, file: File) -> File:
|
|
56
|
-
"""Create a new file record."""
|
|
57
|
-
raise NotImplementedError
|
|
58
|
-
|
|
59
|
-
async def upsert_author(self, author: Author) -> Author:
|
|
60
|
-
"""Create a new author or return existing one if email already exists."""
|
|
61
|
-
raise NotImplementedError
|
|
62
|
-
|
|
63
|
-
async def upsert_author_file_mapping(
|
|
64
|
-
self, mapping: "AuthorFileMapping"
|
|
65
|
-
) -> "AuthorFileMapping":
|
|
66
|
-
"""Create a new author file mapping or return existing one if already exists."""
|
|
67
|
-
raise NotImplementedError
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
class AuthorRepository(GenericRepository[Author]):
|
|
71
|
-
"""Author repository with specific methods."""
|
|
72
|
-
|
|
73
|
-
async def get_by_name(self, name: str) -> Author | None:
|
|
74
|
-
"""Get an author by name."""
|
|
75
|
-
raise NotImplementedError
|
|
76
|
-
|
|
77
|
-
async def get_by_email(self, email: str) -> Author | None:
|
|
78
|
-
"""Get an author by email."""
|
|
79
|
-
raise NotImplementedError
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
class SnippetRepository(GenericRepository[Snippet]):
|
|
83
|
-
"""Snippet repository with specific methods."""
|
|
84
|
-
|
|
85
|
-
async def get_by_index(self, index_id: int) -> Sequence[Snippet]:
|
|
86
|
-
"""Get all snippets for an index."""
|
|
87
|
-
raise NotImplementedError
|
|
88
|
-
|
|
89
|
-
async def delete_by_index(self, index_id: int) -> None:
|
|
90
|
-
"""Delete all snippets for an index."""
|
|
91
|
-
raise NotImplementedError
|
|
92
|
-
|
|
93
|
-
async def list_snippets(
|
|
94
|
-
self, file_path: str | None = None, source_uri: str | None = None
|
|
95
|
-
) -> Sequence[SnippetWithContext]:
|
|
96
|
-
"""List snippets with optional filtering by file path and source URI.
|
|
97
|
-
|
|
98
|
-
Args:
|
|
99
|
-
file_path: Optional file or directory path to filter by. Can be relative
|
|
100
|
-
(uri) or absolute (cloned_path).
|
|
101
|
-
source_uri: Optional source URI to filter by. If None, returns snippets from
|
|
102
|
-
all sources.
|
|
103
|
-
|
|
104
|
-
Returns:
|
|
105
|
-
A sequence of SnippetWithContext instances matching the criteria
|
|
106
|
-
|
|
107
|
-
"""
|
|
108
|
-
raise NotImplementedError
|
|
109
|
-
|
|
110
|
-
async def search(self, request: MultiSearchRequest) -> Sequence[SnippetWithContext]:
|
|
111
|
-
"""Search snippets with filters.
|
|
112
|
-
|
|
113
|
-
Args:
|
|
114
|
-
request: The search request containing queries and optional filters.
|
|
115
|
-
|
|
116
|
-
Returns:
|
|
117
|
-
A sequence of SnippetWithContext instances matching the search criteria.
|
|
118
|
-
|
|
119
|
-
"""
|
|
120
|
-
raise NotImplementedError
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
class FileRepository(GenericRepository[File]):
|
|
124
|
-
"""File repository with specific methods."""
|
|
125
|
-
|
|
126
|
-
async def get_files_for_index(self, index_id: int) -> Sequence[File]:
|
|
127
|
-
"""Get all files for an index."""
|
|
128
|
-
raise NotImplementedError
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"""Domain service for ignore patterns."""
|
|
2
|
-
|
|
3
|
-
from abc import ABC, abstractmethod
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class IgnorePatternProvider(ABC):
|
|
8
|
-
"""Abstract interface for ignore pattern providers."""
|
|
9
|
-
|
|
10
|
-
@abstractmethod
|
|
11
|
-
def should_ignore(self, path: Path) -> bool:
|
|
12
|
-
"""Check if a path should be ignored.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
path: The path to check.
|
|
16
|
-
|
|
17
|
-
Returns:
|
|
18
|
-
True if the path should be ignored, False otherwise.
|
|
19
|
-
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class IgnoreService:
|
|
24
|
-
"""Domain service for managing ignore patterns."""
|
|
25
|
-
|
|
26
|
-
def __init__(self, ignore_pattern_provider: IgnorePatternProvider) -> None:
|
|
27
|
-
"""Initialize the ignore service.
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
ignore_pattern_provider: The ignore pattern provider to use.
|
|
31
|
-
|
|
32
|
-
"""
|
|
33
|
-
self.ignore_pattern_provider = ignore_pattern_provider
|
|
34
|
-
|
|
35
|
-
def should_ignore(self, path: Path) -> bool:
|
|
36
|
-
"""Check if a path should be ignored.
|
|
37
|
-
|
|
38
|
-
Args:
|
|
39
|
-
path: The path to check.
|
|
40
|
-
|
|
41
|
-
Returns:
|
|
42
|
-
True if the path should be ignored, False otherwise.
|
|
43
|
-
|
|
44
|
-
"""
|
|
45
|
-
return self.ignore_pattern_provider.should_ignore(path)
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"""Domain service for indexing operations."""
|
|
2
|
-
|
|
3
|
-
from abc import ABC, abstractmethod
|
|
4
|
-
|
|
5
|
-
from kodit.domain.entities import Snippet
|
|
6
|
-
from kodit.domain.value_objects import (
|
|
7
|
-
FusionRequest,
|
|
8
|
-
FusionResult,
|
|
9
|
-
IndexCreateRequest,
|
|
10
|
-
IndexView,
|
|
11
|
-
SnippetWithContext,
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class IndexRepository(ABC):
|
|
16
|
-
"""Abstract index repository interface."""
|
|
17
|
-
|
|
18
|
-
@abstractmethod
|
|
19
|
-
async def create_index(self, source_id: int) -> IndexView:
|
|
20
|
-
"""Create a new index for a source."""
|
|
21
|
-
|
|
22
|
-
@abstractmethod
|
|
23
|
-
async def get_index_by_id(self, index_id: int) -> IndexView | None:
|
|
24
|
-
"""Get an index by its ID."""
|
|
25
|
-
|
|
26
|
-
@abstractmethod
|
|
27
|
-
async def get_index_by_source_id(self, source_id: int) -> IndexView | None:
|
|
28
|
-
"""Get an index by its source ID."""
|
|
29
|
-
|
|
30
|
-
@abstractmethod
|
|
31
|
-
async def list_indexes(self) -> list[IndexView]:
|
|
32
|
-
"""List all indexes."""
|
|
33
|
-
|
|
34
|
-
@abstractmethod
|
|
35
|
-
async def update_index_timestamp(self, index_id: int) -> None:
|
|
36
|
-
"""Update the timestamp of an index."""
|
|
37
|
-
|
|
38
|
-
@abstractmethod
|
|
39
|
-
async def delete_all_snippets(self, index_id: int) -> None:
|
|
40
|
-
"""Delete all snippets for an index."""
|
|
41
|
-
|
|
42
|
-
@abstractmethod
|
|
43
|
-
async def get_snippets_for_index(self, index_id: int) -> list[Snippet]:
|
|
44
|
-
"""Get all snippets for an index."""
|
|
45
|
-
|
|
46
|
-
@abstractmethod
|
|
47
|
-
async def add_snippet(self, snippet: dict) -> None:
|
|
48
|
-
"""Add a snippet to the database."""
|
|
49
|
-
|
|
50
|
-
@abstractmethod
|
|
51
|
-
async def update_snippet_content(self, snippet_id: int, content: str) -> None:
|
|
52
|
-
"""Update the content of an existing snippet."""
|
|
53
|
-
|
|
54
|
-
@abstractmethod
|
|
55
|
-
async def list_snippets_by_ids(self, ids: list[int]) -> list[SnippetWithContext]:
|
|
56
|
-
"""List snippets by IDs."""
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class FusionService(ABC):
|
|
60
|
-
"""Abstract fusion service interface."""
|
|
61
|
-
|
|
62
|
-
@abstractmethod
|
|
63
|
-
def reciprocal_rank_fusion(
|
|
64
|
-
self, rankings: list[list[FusionRequest]], k: float = 60
|
|
65
|
-
) -> list[FusionResult]:
|
|
66
|
-
"""Perform reciprocal rank fusion on search results."""
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class IndexingDomainService:
|
|
70
|
-
"""Domain service for indexing operations."""
|
|
71
|
-
|
|
72
|
-
def __init__(
|
|
73
|
-
self, index_repository: IndexRepository, fusion_service: FusionService
|
|
74
|
-
) -> None:
|
|
75
|
-
"""Initialize the indexing domain service.
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
index_repository: Repository for index operations
|
|
79
|
-
fusion_service: Service for result fusion
|
|
80
|
-
|
|
81
|
-
"""
|
|
82
|
-
self.index_repository = index_repository
|
|
83
|
-
self.fusion_service = fusion_service
|
|
84
|
-
|
|
85
|
-
async def create_index(self, request: IndexCreateRequest) -> IndexView:
|
|
86
|
-
"""Create a new index.
|
|
87
|
-
|
|
88
|
-
Args:
|
|
89
|
-
request: The index create request.
|
|
90
|
-
|
|
91
|
-
Returns:
|
|
92
|
-
The created index view.
|
|
93
|
-
|
|
94
|
-
"""
|
|
95
|
-
return await self.index_repository.create_index(request.source_id)
|
|
96
|
-
|
|
97
|
-
async def get_index(self, index_id: int) -> IndexView | None:
|
|
98
|
-
"""Get an index by its ID.
|
|
99
|
-
|
|
100
|
-
Args:
|
|
101
|
-
index_id: The ID of the index to retrieve.
|
|
102
|
-
|
|
103
|
-
Returns:
|
|
104
|
-
The index view if found, None otherwise.
|
|
105
|
-
|
|
106
|
-
"""
|
|
107
|
-
return await self.index_repository.get_index_by_id(index_id)
|
|
108
|
-
|
|
109
|
-
async def get_index_by_source_id(self, source_id: int) -> IndexView | None:
|
|
110
|
-
"""Get an index by its source ID.
|
|
111
|
-
|
|
112
|
-
Args:
|
|
113
|
-
source_id: The ID of the source to retrieve an index for.
|
|
114
|
-
|
|
115
|
-
Returns:
|
|
116
|
-
The index view if found, None otherwise.
|
|
117
|
-
|
|
118
|
-
"""
|
|
119
|
-
return await self.index_repository.get_index_by_source_id(source_id)
|
|
120
|
-
|
|
121
|
-
async def list_indexes(self) -> list[IndexView]:
|
|
122
|
-
"""List all indexes.
|
|
123
|
-
|
|
124
|
-
Returns:
|
|
125
|
-
A list of index views.
|
|
126
|
-
|
|
127
|
-
"""
|
|
128
|
-
return await self.index_repository.list_indexes()
|
|
129
|
-
|
|
130
|
-
async def update_index_timestamp(self, index_id: int) -> None:
|
|
131
|
-
"""Update the timestamp of an index.
|
|
132
|
-
|
|
133
|
-
Args:
|
|
134
|
-
index_id: The ID of the index to update.
|
|
135
|
-
|
|
136
|
-
"""
|
|
137
|
-
await self.index_repository.update_index_timestamp(index_id)
|
|
138
|
-
|
|
139
|
-
async def delete_all_snippets(self, index_id: int) -> None:
|
|
140
|
-
"""Delete all snippets for an index.
|
|
141
|
-
|
|
142
|
-
Args:
|
|
143
|
-
index_id: The ID of the index to delete snippets for.
|
|
144
|
-
|
|
145
|
-
"""
|
|
146
|
-
await self.index_repository.delete_all_snippets(index_id)
|
|
147
|
-
|
|
148
|
-
async def get_snippets_for_index(self, index_id: int) -> list[Snippet]:
|
|
149
|
-
"""Get all snippets for an index.
|
|
150
|
-
|
|
151
|
-
Args:
|
|
152
|
-
index_id: The ID of the index to get snippets for.
|
|
153
|
-
|
|
154
|
-
Returns:
|
|
155
|
-
A list of Snippet entities.
|
|
156
|
-
|
|
157
|
-
"""
|
|
158
|
-
return await self.index_repository.get_snippets_for_index(index_id)
|
|
159
|
-
|
|
160
|
-
async def add_snippet(self, snippet: dict) -> None:
|
|
161
|
-
"""Add a snippet to the database.
|
|
162
|
-
|
|
163
|
-
Args:
|
|
164
|
-
snippet: The snippet to add.
|
|
165
|
-
|
|
166
|
-
"""
|
|
167
|
-
await self.index_repository.add_snippet(snippet)
|
|
168
|
-
|
|
169
|
-
async def update_snippet_content(self, snippet_id: int, content: str) -> None:
|
|
170
|
-
"""Update the content of an existing snippet.
|
|
171
|
-
|
|
172
|
-
Args:
|
|
173
|
-
snippet_id: The ID of the snippet to update.
|
|
174
|
-
content: The new content for the snippet.
|
|
175
|
-
|
|
176
|
-
"""
|
|
177
|
-
await self.index_repository.update_snippet_content(snippet_id, content)
|
|
178
|
-
|
|
179
|
-
def perform_fusion(
|
|
180
|
-
self, rankings: list[list[FusionRequest]], k: float = 60
|
|
181
|
-
) -> list[FusionResult]:
|
|
182
|
-
"""Perform fusion on search results.
|
|
183
|
-
|
|
184
|
-
Args:
|
|
185
|
-
rankings: List of rankings to fuse.
|
|
186
|
-
k: Parameter for reciprocal rank fusion.
|
|
187
|
-
|
|
188
|
-
Returns:
|
|
189
|
-
Fused search results.
|
|
190
|
-
|
|
191
|
-
"""
|
|
192
|
-
return self.fusion_service.reciprocal_rank_fusion(rankings, k)
|
|
193
|
-
|
|
194
|
-
async def get_snippets_by_ids(self, ids: list[int]) -> list[SnippetWithContext]:
|
|
195
|
-
"""Get snippets by IDs.
|
|
196
|
-
|
|
197
|
-
Args:
|
|
198
|
-
ids: List of snippet IDs to retrieve.
|
|
199
|
-
|
|
200
|
-
Returns:
|
|
201
|
-
List of SnippetWithFile objects containing file and snippet information.
|
|
202
|
-
|
|
203
|
-
"""
|
|
204
|
-
return await self.index_repository.list_snippets_by_ids(ids)
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"""Domain services for snippet extraction."""
|
|
2
|
-
|
|
3
|
-
from abc import ABC, abstractmethod
|
|
4
|
-
from collections.abc import Mapping
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
from kodit.domain.enums import SnippetExtractionStrategy
|
|
8
|
-
from kodit.domain.value_objects import SnippetExtractionRequest, SnippetExtractionResult
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class LanguageDetectionService(ABC):
|
|
12
|
-
"""Abstract interface for language detection service."""
|
|
13
|
-
|
|
14
|
-
@abstractmethod
|
|
15
|
-
async def detect_language(self, file_path: Path) -> str:
|
|
16
|
-
"""Detect the programming language of a file."""
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class SnippetExtractor(ABC):
|
|
20
|
-
"""Abstract interface for snippet extraction."""
|
|
21
|
-
|
|
22
|
-
@abstractmethod
|
|
23
|
-
async def extract(self, file_path: Path, language: str) -> list[str]:
|
|
24
|
-
"""Extract snippets from a file."""
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class SnippetExtractionService(ABC):
|
|
28
|
-
"""Domain service for extracting snippets from source code."""
|
|
29
|
-
|
|
30
|
-
@abstractmethod
|
|
31
|
-
async def extract_snippets(
|
|
32
|
-
self, request: SnippetExtractionRequest
|
|
33
|
-
) -> SnippetExtractionResult:
|
|
34
|
-
"""Extract snippets from a file using the specified strategy."""
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class SnippetExtractionDomainService:
|
|
38
|
-
"""Domain service implementation for snippet extraction business logic."""
|
|
39
|
-
|
|
40
|
-
def __init__(
|
|
41
|
-
self,
|
|
42
|
-
language_detector: LanguageDetectionService,
|
|
43
|
-
snippet_extractors: Mapping[SnippetExtractionStrategy, SnippetExtractor],
|
|
44
|
-
) -> None:
|
|
45
|
-
"""Initialize the snippet extraction domain service.
|
|
46
|
-
|
|
47
|
-
Args:
|
|
48
|
-
language_detector: Service for detecting programming languages
|
|
49
|
-
snippet_extractors: Dictionary mapping strategies to extractor
|
|
50
|
-
implementations
|
|
51
|
-
|
|
52
|
-
"""
|
|
53
|
-
self.language_detector = language_detector
|
|
54
|
-
self.snippet_extractors = snippet_extractors
|
|
55
|
-
|
|
56
|
-
async def extract_snippets(
|
|
57
|
-
self, request: SnippetExtractionRequest
|
|
58
|
-
) -> SnippetExtractionResult:
|
|
59
|
-
"""Extract snippets from a file using the specified strategy.
|
|
60
|
-
|
|
61
|
-
Args:
|
|
62
|
-
request: The snippet extraction request
|
|
63
|
-
|
|
64
|
-
Returns:
|
|
65
|
-
SnippetExtractionResult containing the extracted snippets and
|
|
66
|
-
detected language
|
|
67
|
-
|
|
68
|
-
Raises:
|
|
69
|
-
ValueError: If the file doesn't exist or strategy is unsupported
|
|
70
|
-
|
|
71
|
-
"""
|
|
72
|
-
# Domain logic: validate file exists
|
|
73
|
-
if not request.file_path.exists():
|
|
74
|
-
raise ValueError(f"File does not exist: {request.file_path}")
|
|
75
|
-
|
|
76
|
-
# Domain logic: detect language
|
|
77
|
-
language = await self.language_detector.detect_language(request.file_path)
|
|
78
|
-
|
|
79
|
-
# Domain logic: choose strategy and extractor
|
|
80
|
-
if request.strategy not in self.snippet_extractors:
|
|
81
|
-
raise ValueError(f"Unsupported extraction strategy: {request.strategy}")
|
|
82
|
-
|
|
83
|
-
extractor = self.snippet_extractors[request.strategy]
|
|
84
|
-
snippets = await extractor.extract(request.file_path, language)
|
|
85
|
-
|
|
86
|
-
# Domain logic: filter out empty snippets
|
|
87
|
-
filtered_snippets = [snippet for snippet in snippets if snippet.strip()]
|
|
88
|
-
|
|
89
|
-
return SnippetExtractionResult(snippets=filtered_snippets, language=language)
|