cocoindex-code 0.2.2__tar.gz → 0.2.4__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.
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/PKG-INFO +2 -2
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/pyproject.toml +1 -1
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/_version.py +2 -2
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/cli.py +19 -4
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/client.py +5 -5
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/indexer.py +2 -2
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/server.py +19 -4
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/.gitignore +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/LICENSE +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/README.md +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/__init__.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/__main__.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/config.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/daemon.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/project.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/protocol.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/query.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/schema.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/settings.py +0 -0
- {cocoindex_code-0.2.2 → cocoindex_code-0.2.4}/src/cocoindex_code/shared.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cocoindex-code
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: MCP server for indexing and querying codebases using CocoIndex
|
|
5
5
|
Project-URL: Homepage, https://github.com/cocoindex-io/cocoindex-code
|
|
6
6
|
Project-URL: Repository, https://github.com/cocoindex-io/cocoindex-code
|
|
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
19
|
Requires-Python: >=3.11
|
|
20
|
-
Requires-Dist: cocoindex[litellm]==1.0.
|
|
20
|
+
Requires-Dist: cocoindex[litellm]==1.0.0a35
|
|
21
21
|
Requires-Dist: einops>=0.8.2
|
|
22
22
|
Requires-Dist: mcp>=1.0.0
|
|
23
23
|
Requires-Dist: msgspec>=0.19.0
|
|
@@ -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.2.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 2,
|
|
31
|
+
__version__ = version = '0.2.4'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 2, 4)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -449,19 +449,34 @@ def mcp() -> None:
|
|
|
449
449
|
|
|
450
450
|
mcp_server = create_mcp_server(client, project_root)
|
|
451
451
|
# Trigger initial indexing in background
|
|
452
|
-
asyncio.create_task(_bg_index(
|
|
452
|
+
asyncio.create_task(_bg_index(project_root))
|
|
453
453
|
await mcp_server.run_stdio_async()
|
|
454
454
|
|
|
455
455
|
asyncio.run(_run_mcp())
|
|
456
456
|
|
|
457
457
|
|
|
458
|
-
async def _bg_index(
|
|
459
|
-
"""Index in background
|
|
458
|
+
async def _bg_index(project_root: str) -> None:
|
|
459
|
+
"""Index in background using a dedicated daemon connection.
|
|
460
|
+
|
|
461
|
+
A fresh DaemonClient is used so that background indexing does not share
|
|
462
|
+
the multiprocessing connection used by foreground MCP requests, which
|
|
463
|
+
would corrupt data ("Input data was truncated").
|
|
464
|
+
"""
|
|
460
465
|
import asyncio
|
|
461
466
|
|
|
467
|
+
from .client import ensure_daemon
|
|
468
|
+
|
|
462
469
|
loop = asyncio.get_event_loop()
|
|
470
|
+
|
|
471
|
+
def _run_index() -> None:
|
|
472
|
+
bg_client = ensure_daemon()
|
|
473
|
+
try:
|
|
474
|
+
bg_client.index(project_root)
|
|
475
|
+
finally:
|
|
476
|
+
bg_client.close()
|
|
477
|
+
|
|
463
478
|
try:
|
|
464
|
-
await loop.run_in_executor(None,
|
|
479
|
+
await loop.run_in_executor(None, _run_index)
|
|
465
480
|
except Exception:
|
|
466
481
|
pass
|
|
467
482
|
|
|
@@ -205,16 +205,16 @@ def start_daemon() -> None:
|
|
|
205
205
|
|
|
206
206
|
log_fd = open(log_path, "a")
|
|
207
207
|
if sys.platform == "win32":
|
|
208
|
-
#
|
|
209
|
-
#
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
# CREATE_NO_WINDOW prevents the daemon from showing a visible
|
|
209
|
+
# console window. DETACHED_PROCESS alone is not sufficient —
|
|
210
|
+
# it detaches from the parent console but still creates a new one.
|
|
211
|
+
_create_no_window = 0x08000000
|
|
212
212
|
subprocess.Popen(
|
|
213
213
|
cmd,
|
|
214
214
|
stdout=log_fd,
|
|
215
215
|
stderr=log_fd,
|
|
216
216
|
stdin=subprocess.DEVNULL,
|
|
217
|
-
creationflags=
|
|
217
|
+
creationflags=_create_no_window,
|
|
218
218
|
)
|
|
219
219
|
else:
|
|
220
220
|
subprocess.Popen(
|
|
@@ -327,16 +327,31 @@ def main() -> None:
|
|
|
327
327
|
mcp_server = create_mcp_server(client, str(project_root))
|
|
328
328
|
|
|
329
329
|
async def _serve() -> None:
|
|
330
|
-
asyncio.create_task(_bg_index(
|
|
330
|
+
asyncio.create_task(_bg_index(str(project_root)))
|
|
331
331
|
await mcp_server.run_stdio_async()
|
|
332
332
|
|
|
333
333
|
asyncio.run(_serve())
|
|
334
334
|
|
|
335
335
|
|
|
336
|
-
async def _bg_index(
|
|
337
|
-
"""Index in background.
|
|
336
|
+
async def _bg_index(project_root: str) -> None:
|
|
337
|
+
"""Index in background using a dedicated daemon connection.
|
|
338
|
+
|
|
339
|
+
A fresh DaemonClient is used so that background indexing does not share
|
|
340
|
+
the multiprocessing connection used by foreground MCP requests, which
|
|
341
|
+
would corrupt data ("Input data was truncated").
|
|
342
|
+
"""
|
|
343
|
+
from .client import ensure_daemon
|
|
344
|
+
|
|
338
345
|
loop = asyncio.get_event_loop()
|
|
346
|
+
|
|
347
|
+
def _run_index() -> None:
|
|
348
|
+
bg_client = ensure_daemon()
|
|
349
|
+
try:
|
|
350
|
+
bg_client.index(project_root)
|
|
351
|
+
finally:
|
|
352
|
+
bg_client.close()
|
|
353
|
+
|
|
339
354
|
try:
|
|
340
|
-
await loop.run_in_executor(None,
|
|
355
|
+
await loop.run_in_executor(None, _run_index)
|
|
341
356
|
except Exception:
|
|
342
357
|
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|