cocoindex-code 0.2.32__tar.gz → 0.2.33__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.
Files changed (25) hide show
  1. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/PKG-INFO +1 -1
  2. cocoindex_code-0.2.33/src/cocoindex_code/__init__.py +23 -0
  3. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/_version.py +2 -2
  4. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/cli.py +13 -4
  5. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/settings.py +6 -2
  6. cocoindex_code-0.2.32/src/cocoindex_code/__init__.py +0 -10
  7. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/.gitignore +0 -0
  8. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/LICENSE +0 -0
  9. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/README.md +0 -0
  10. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/pyproject.toml +0 -0
  11. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/__main__.py +0 -0
  12. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/_daemon_paths.py +0 -0
  13. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/chunking.py +0 -0
  14. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/client.py +0 -0
  15. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/daemon.py +0 -0
  16. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/embedder_defaults.py +0 -0
  17. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/embedder_params.py +0 -0
  18. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/indexer.py +0 -0
  19. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/litellm_embedder.py +0 -0
  20. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/project.py +0 -0
  21. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/protocol.py +0 -0
  22. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/query.py +0 -0
  23. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/schema.py +0 -0
  24. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/src/cocoindex_code/server.py +0 -0
  25. {cocoindex_code-0.2.32 → cocoindex_code-0.2.33}/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.32
3
+ Version: 0.2.33
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
@@ -0,0 +1,23 @@
1
+ """CocoIndex Code - MCP server for indexing and querying codebases."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import logging
6
+ from typing import TYPE_CHECKING, Any
7
+
8
+ logging.basicConfig(level=logging.WARNING)
9
+
10
+ from ._version import __version__ # noqa: E402
11
+
12
+ if TYPE_CHECKING:
13
+ from .server import main as main
14
+
15
+ __all__ = ["main", "__version__"]
16
+
17
+
18
+ def __getattr__(name: str) -> Any:
19
+ if name == "main":
20
+ from .server import main
21
+
22
+ return main
23
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.2.32'
22
- __version_tuple__ = version_tuple = (0, 2, 32)
21
+ __version__ = version = '0.2.33'
22
+ __version_tuple__ = version_tuple = (0, 2, 33)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -7,12 +7,18 @@ import os
7
7
  import sys
8
8
  from collections.abc import Callable
9
9
  from pathlib import Path
10
- from typing import TypeVar
10
+ from typing import TYPE_CHECKING, TypeVar
11
11
 
12
12
  import typer as _typer
13
13
 
14
- from .client import DaemonStartError
15
- from .protocol import DoctorCheckResult, IndexingProgress, ProjectStatusResponse, SearchResponse
14
+ if TYPE_CHECKING:
15
+ from .protocol import (
16
+ DoctorCheckResult,
17
+ IndexingProgress,
18
+ ProjectStatusResponse,
19
+ SearchResponse,
20
+ )
21
+
16
22
  from .settings import (
17
23
  DEFAULT_ST_MODEL,
18
24
  EmbeddingSettings,
@@ -104,6 +110,8 @@ def _catch_daemon_start_error(func: _F) -> _F:
104
110
 
105
111
  @functools.wraps(func)
106
112
  def wrapper(*args: object, **kwargs: object) -> object:
113
+ from .client import DaemonStartError
114
+
107
115
  try:
108
116
  return func(*args, **kwargs)
109
117
  except DaemonStartError as e:
@@ -204,7 +212,7 @@ def _run_index_with_progress(project_root: str) -> None:
204
212
  except RuntimeError as e:
205
213
  live.stop()
206
214
  # Let DaemonStartError propagate to the decorator for consistent handling.
207
- if isinstance(e, DaemonStartError):
215
+ if isinstance(e, _client.DaemonStartError):
208
216
  raise
209
217
  _typer.echo(f"Indexing failed: {e}", err=True)
210
218
  raise _typer.Exit(code=1)
@@ -397,6 +405,7 @@ def _run_init_model_check(settings_path: Path) -> None:
397
405
  from rich.spinner import Spinner as _Spinner
398
406
 
399
407
  from . import client as _client
408
+ from .protocol import DoctorCheckResult
400
409
 
401
410
  err_console = _Console(stderr=True)
402
411
  results: list[DoctorCheckResult] = []
@@ -5,10 +5,12 @@ from __future__ import annotations
5
5
  import os
6
6
  from dataclasses import dataclass, field
7
7
  from pathlib import Path
8
- from typing import Any
8
+ from typing import TYPE_CHECKING, Any
9
9
 
10
10
  import yaml as _yaml
11
- from pathspec import GitIgnoreSpec
11
+
12
+ if TYPE_CHECKING:
13
+ from pathspec import GitIgnoreSpec
12
14
 
13
15
  # ---------------------------------------------------------------------------
14
16
  # Default file patterns (moved from indexer.py)
@@ -391,6 +393,8 @@ def global_settings_mtime_us() -> int | None:
391
393
 
392
394
  def load_gitignore_spec(project_root: Path) -> GitIgnoreSpec | None:
393
395
  """Load a GitIgnoreSpec for the project's ``.gitignore`` if present."""
396
+ from pathspec import GitIgnoreSpec
397
+
394
398
  gitignore = project_root / ".gitignore"
395
399
  if not gitignore.is_file():
396
400
  return None
@@ -1,10 +0,0 @@
1
- """CocoIndex Code - MCP server for indexing and querying codebases."""
2
-
3
- import logging
4
-
5
- logging.basicConfig(level=logging.WARNING)
6
-
7
- from ._version import __version__ # noqa: E402
8
- from .server import main # noqa: E402
9
-
10
- __all__ = ["main", "__version__"]
File without changes