kodit 0.1.3__py3-none-any.whl → 0.1.5__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/alembic/env.py +0 -2
- kodit/app.py +8 -8
- kodit/bm25/__init__.py +1 -0
- kodit/bm25/bm25.py +71 -0
- kodit/cli.py +87 -35
- kodit/config.py +86 -2
- kodit/database.py +38 -55
- kodit/indexing/repository.py +11 -0
- kodit/indexing/service.py +26 -17
- kodit/logging.py +20 -18
- kodit/mcp.py +76 -5
- kodit/retreival/repository.py +32 -0
- kodit/retreival/service.py +41 -3
- kodit/snippets/__init__.py +1 -0
- kodit/snippets/languages/__init__.py +53 -0
- kodit/snippets/languages/csharp.scm +12 -0
- kodit/snippets/languages/python.scm +22 -0
- kodit/snippets/method_snippets.py +120 -0
- kodit/snippets/snippets.py +48 -0
- kodit/sources/service.py +3 -5
- {kodit-0.1.3.dist-info → kodit-0.1.5.dist-info}/METADATA +6 -2
- kodit-0.1.5.dist-info/RECORD +40 -0
- kodit/sse.py +0 -61
- kodit-0.1.3.dist-info/RECORD +0 -33
- {kodit-0.1.3.dist-info → kodit-0.1.5.dist-info}/WHEEL +0 -0
- {kodit-0.1.3.dist-info → kodit-0.1.5.dist-info}/entry_points.txt +0 -0
- {kodit-0.1.3.dist-info → kodit-0.1.5.dist-info}/licenses/LICENSE +0 -0
kodit/sse.py
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"""Server-Sent Events (SSE) implementation for kodit."""
|
|
2
|
-
|
|
3
|
-
from collections.abc import Coroutine
|
|
4
|
-
from typing import Any
|
|
5
|
-
|
|
6
|
-
from fastapi import Request
|
|
7
|
-
from mcp.server.fastmcp import FastMCP
|
|
8
|
-
from mcp.server.session import ServerSession
|
|
9
|
-
from mcp.server.sse import SseServerTransport
|
|
10
|
-
from starlette.applications import Starlette
|
|
11
|
-
from starlette.routing import Mount, Route
|
|
12
|
-
|
|
13
|
-
####################################################################################
|
|
14
|
-
# Temporary monkeypatch which avoids crashing when a POST message is received
|
|
15
|
-
# before a connection has been initialized, e.g: after a deployment.
|
|
16
|
-
old__received_request = ServerSession._received_request # noqa: SLF001
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
async def _received_request(self: ServerSession, *args: Any, **kwargs: Any) -> None:
|
|
20
|
-
"""Handle a received request, catching RuntimeError to avoid crashes.
|
|
21
|
-
|
|
22
|
-
This is a temporary monkeypatch to avoid crashing when a POST message is
|
|
23
|
-
received before a connection has been initialized, e.g: after a deployment.
|
|
24
|
-
"""
|
|
25
|
-
try:
|
|
26
|
-
return await old__received_request(self, *args, **kwargs)
|
|
27
|
-
except RuntimeError:
|
|
28
|
-
pass
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# pylint: disable-next=protected-access
|
|
32
|
-
ServerSession._received_request = _received_request # noqa: SLF001
|
|
33
|
-
####################################################################################
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def create_sse_server(mcp: FastMCP) -> Starlette:
|
|
37
|
-
"""Create a Starlette app that handles SSE connections and message handling."""
|
|
38
|
-
transport = SseServerTransport("/messages/")
|
|
39
|
-
|
|
40
|
-
# Define handler functions
|
|
41
|
-
async def handle_sse(request: Request) -> Coroutine[Any, Any, None]:
|
|
42
|
-
"""Handle SSE connections."""
|
|
43
|
-
async with transport.connect_sse(
|
|
44
|
-
request.scope,
|
|
45
|
-
request.receive,
|
|
46
|
-
request._send, # noqa: SLF001
|
|
47
|
-
) as streams:
|
|
48
|
-
await mcp._mcp_server.run( # noqa: SLF001
|
|
49
|
-
streams[0],
|
|
50
|
-
streams[1],
|
|
51
|
-
mcp._mcp_server.create_initialization_options(), # noqa: SLF001
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
# Create Starlette routes for SSE and message handling
|
|
55
|
-
routes = [
|
|
56
|
-
Route("/sse/", endpoint=handle_sse),
|
|
57
|
-
Mount("/messages/", app=transport.handle_post_message),
|
|
58
|
-
]
|
|
59
|
-
|
|
60
|
-
# Create a Starlette app
|
|
61
|
-
return Starlette(routes=routes)
|
kodit-0.1.3.dist-info/RECORD
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
kodit/.gitignore,sha256=ztkjgRwL9Uud1OEi36hGQeDGk3OLK1NfDEO8YqGYy8o,11
|
|
2
|
-
kodit/__init__.py,sha256=aEKHYninUq1yh6jaNfvJBYg-6fenpN132nJt1UU6Jxs,59
|
|
3
|
-
kodit/_version.py,sha256=NIzzV8ZM0W-CSLuEs1weG4zPrn_-8yr1AwwI1iuS6yo,511
|
|
4
|
-
kodit/app.py,sha256=FBAeeOz2CICvVN_27iMq9wEF9y8d1IDl0WmkEnM_M_U,699
|
|
5
|
-
kodit/cli.py,sha256=2hNz05I6vryhkGqwMXlg_GKVAzhMmS_v8H2Nl6oxBZ4,5696
|
|
6
|
-
kodit/config.py,sha256=Wq9MlxOnOA3p9mgIzsq-s7N57_GFVIOMML-4GFINmqE,104
|
|
7
|
-
kodit/database.py,sha256=ndStVWzR5XAiZ1JBu_NE4Nv-KLEZ3GQVLVjPIUmiRA4,2457
|
|
8
|
-
kodit/logging.py,sha256=dQr4YXVH8_B52V0wXbBrn_HvH4QpO-fsi0C3JPWzn0Y,5022
|
|
9
|
-
kodit/mcp.py,sha256=Sg7Waes9Z7HYzdglspG92dGhTVtb1lEaEKW-vlaUCXg,1488
|
|
10
|
-
kodit/middleware.py,sha256=NHLrqq20ZtPTE9esX9HD3z7EKi56_QTFxBlkdq0JDzQ,2138
|
|
11
|
-
kodit/sse.py,sha256=UgwXJUeFq5D5S9KYKVVg4m6P0-_QHnJOCRRQB8XNR-M,2259
|
|
12
|
-
kodit/alembic/README,sha256=ISVtAOvqvKk_5ThM5ioJE-lMkvf9IbknFUFVU_vPma4,58
|
|
13
|
-
kodit/alembic/__init__.py,sha256=lP5MuwlyWRMO6UcDWnQcQ3G-GYHcFb6rl9gYPHJ1sjo,40
|
|
14
|
-
kodit/alembic/env.py,sha256=WnmwmN6wKEThI17b-VPDkRq-nKfmaT6nRLabc2VM1oM,2390
|
|
15
|
-
kodit/alembic/script.py.mako,sha256=zWziKtiwYKEWuwPV_HBNHwa9LCT45_bi01-uSNFaOOE,703
|
|
16
|
-
kodit/alembic/versions/85155663351e_initial.py,sha256=Cg7zlF871o9ShV5rQMQ1v7hRV7fI59veDY9cjtTrs-8,3306
|
|
17
|
-
kodit/alembic/versions/__init__.py,sha256=9-lHzptItTzq_fomdIRBegQNm4Znx6pVjwD4MiqRIdo,36
|
|
18
|
-
kodit/indexing/__init__.py,sha256=cPyi2Iej3G1JFWlWr7X80_UrsMaTu5W5rBwgif1B3xo,75
|
|
19
|
-
kodit/indexing/models.py,sha256=sZIhGwvL4Dw0QTWFxrjfWctSLkAoDT6fv5DlGz8-Fr8,1258
|
|
20
|
-
kodit/indexing/repository.py,sha256=GeRpgRNOZunEKtzkkqkJWlOaR8cpGMX4rI_puDdB8WY,4006
|
|
21
|
-
kodit/indexing/service.py,sha256=COiOCNmZN0QKgazXB4dEpHnL1pi002td6n7PRo0d17I,4985
|
|
22
|
-
kodit/retreival/__init__.py,sha256=33PhJU-3gtsqYq6A1UkaLNKbev_Zee9Lq6dYC59-CsA,69
|
|
23
|
-
kodit/retreival/repository.py,sha256=WJQiePfeuwnj8Vy6dqF4bhNhsWqH9VspjN2zlvYQWvY,2273
|
|
24
|
-
kodit/retreival/service.py,sha256=Iy9IBLhohQmypeOs0hDEjgr1hsr0xtaiMqjIzykFWrY,727
|
|
25
|
-
kodit/sources/__init__.py,sha256=1NTZyPdjThVQpZO1Mp1ColVsS7sqYanOVLqnoqV9Ipo,83
|
|
26
|
-
kodit/sources/models.py,sha256=xb42CaNDO1CUB8SIW-xXMrB6Ji8cFw-yeJ550xBEg9Q,2398
|
|
27
|
-
kodit/sources/repository.py,sha256=mGJrHWH6Uo8YABdoojHFbzaf_jW-2ywJpAHIa1gnc3U,3401
|
|
28
|
-
kodit/sources/service.py,sha256=khrz3UH6hNTYwXMFosGc46trcb8Sm0dTPwvptbgRgwM,6722
|
|
29
|
-
kodit-0.1.3.dist-info/METADATA,sha256=1Q0EP_fo9liqZoW_3QGXMphCj05jtgYxfIwMb4o4e5c,2019
|
|
30
|
-
kodit-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
31
|
-
kodit-0.1.3.dist-info/entry_points.txt,sha256=hoTn-1aKyTItjnY91fnO-rV5uaWQLQ-Vi7V5et2IbHY,40
|
|
32
|
-
kodit-0.1.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
33
|
-
kodit-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|