cocoindex-code 0.1.13__tar.gz → 0.2.0__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 (24) hide show
  1. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/.gitignore +5 -2
  2. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/PKG-INFO +21 -6
  3. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/README.md +15 -4
  4. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/pyproject.toml +11 -1
  5. cocoindex_code-0.2.0/src/cocoindex_code/__init__.py +10 -0
  6. cocoindex_code-0.2.0/src/cocoindex_code/_version.py +34 -0
  7. cocoindex_code-0.2.0/src/cocoindex_code/cli.py +512 -0
  8. cocoindex_code-0.2.0/src/cocoindex_code/client.py +422 -0
  9. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/src/cocoindex_code/config.py +31 -12
  10. cocoindex_code-0.2.0/src/cocoindex_code/daemon.py +547 -0
  11. cocoindex_code-0.2.0/src/cocoindex_code/indexer.py +220 -0
  12. cocoindex_code-0.2.0/src/cocoindex_code/project.py +124 -0
  13. cocoindex_code-0.2.0/src/cocoindex_code/protocol.py +184 -0
  14. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/src/cocoindex_code/query.py +13 -15
  15. cocoindex_code-0.2.0/src/cocoindex_code/server.py +341 -0
  16. cocoindex_code-0.2.0/src/cocoindex_code/settings.py +332 -0
  17. cocoindex_code-0.2.0/src/cocoindex_code/shared.py +88 -0
  18. cocoindex_code-0.1.13/src/cocoindex_code/__init__.py +0 -11
  19. cocoindex_code-0.1.13/src/cocoindex_code/indexer.py +0 -165
  20. cocoindex_code-0.1.13/src/cocoindex_code/server.py +0 -249
  21. cocoindex_code-0.1.13/src/cocoindex_code/shared.py +0 -92
  22. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/LICENSE +0 -0
  23. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/src/cocoindex_code/__main__.py +0 -0
  24. {cocoindex_code-0.1.13 → cocoindex_code-0.2.0}/src/cocoindex_code/schema.py +0 -0
@@ -41,5 +41,8 @@ htmlcov/
41
41
  .pytest_cache/
42
42
  .mypy_cache/
43
43
 
44
- # CocoIndex
45
- .cocoindex_code/
44
+ # Generated version file
45
+ src/cocoindex_code/_version.py
46
+
47
+ # CocoIndex Code (ccc)
48
+ /.cocoindex_code/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex-code
3
- Version: 0.1.13
3
+ Version: 0.2.0
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,13 +17,17 @@ 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.0a28
20
+ Requires-Dist: cocoindex[litellm]==1.0.0a32
21
21
  Requires-Dist: einops>=0.8.2
22
22
  Requires-Dist: mcp>=1.0.0
23
+ Requires-Dist: msgspec>=0.19.0
23
24
  Requires-Dist: numpy>=1.24.0
25
+ Requires-Dist: pathspec>=0.12.1
24
26
  Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: pyyaml>=6.0
25
28
  Requires-Dist: sentence-transformers>=2.2.0
26
29
  Requires-Dist: sqlite-vec>=0.1.0
30
+ Requires-Dist: typer>=0.9.0
27
31
  Provides-Extra: dev
28
32
  Requires-Dist: mypy>=1.0.0; extra == 'dev'
29
33
  Requires-Dist: prek>=0.1.0; extra == 'dev'
@@ -163,8 +167,8 @@ Use the cocoindex-code MCP server for semantic code search when:
163
167
  |----------|-------------|---------|
164
168
  | `COCOINDEX_CODE_ROOT_PATH` | Root path of the codebase | Auto-discovered (see below) |
165
169
  | `COCOINDEX_CODE_EMBEDDING_MODEL` | Embedding model (see below) | `sbert/sentence-transformers/all-MiniLM-L6-v2` |
166
- | `COCOINDEX_CODE_BATCH_SIZE` | Max batch size for local embedding model | `16` |
167
170
  | `COCOINDEX_CODE_EXTRA_EXTENSIONS` | Additional file extensions to index (comma-separated, e.g. `"inc:php,yaml,toml"` — use `ext:lang` to override language detection) | _(none)_ |
171
+ | `COCOINDEX_CODE_EXCLUDED_PATTERNS` | Additional glob patterns to exclude from indexing as a JSON array (e.g. `'["**/migration.sql", "{**/*.md,**/*.txt}"]'`) | _(none)_ |
168
172
 
169
173
 
170
174
  ### Root Path Discovery
@@ -297,14 +301,24 @@ claude mcp add cocoindex-code \
297
301
 
298
302
  Any model supported by LiteLLM works — see the [full list of embedding providers](https://docs.litellm.ai/docs/embedding/supported_embedding).
299
303
 
300
- ### GPU-optimised local model
304
+ ### Local SentenceTransformers models
301
305
 
302
- If you have a GPU, [`nomic-ai/CodeRankEmbed`](https://huggingface.co/nomic-ai/CodeRankEmbed) delivers significantly better code retrieval than the default model. It is 137M parameters, requires ~1 GB VRAM, and has an 8192-token context window.
306
+ Use the `sbert/` prefix to load any [SentenceTransformers](https://www.sbert.net/) model locally (no API key required).
307
+
308
+ **Example — general purpose text model:**
309
+ ```bash
310
+ claude mcp add cocoindex-code \
311
+ -e COCOINDEX_CODE_EMBEDDING_MODEL=sbert/nomic-ai/nomic-embed-text-v1 \
312
+ -- cocoindex-code
313
+ ```
314
+
315
+ **GPU-optimised code retrieval:**
316
+
317
+ [`nomic-ai/CodeRankEmbed`](https://huggingface.co/nomic-ai/CodeRankEmbed) delivers significantly better code retrieval than the default model. It is 137M parameters, requires ~1 GB VRAM, and has an 8192-token context window.
303
318
 
304
319
  ```bash
305
320
  claude mcp add cocoindex-code \
306
321
  -e COCOINDEX_CODE_EMBEDDING_MODEL=sbert/nomic-ai/CodeRankEmbed \
307
- -e COCOINDEX_CODE_BATCH_SIZE=16 \
308
322
  -- cocoindex-code
309
323
  ```
310
324
 
@@ -355,6 +369,7 @@ Returns matching code chunks with:
355
369
  | javascript | js | `.js` |
356
370
  | json | | `.json` |
357
371
  | kotlin | | `.kt`, `.kts` |
372
+ | lua | | `.lua` |
358
373
  | markdown | md | `.md`, `.mdx` |
359
374
  | pascal | pas, dpr, delphi | `.pas`, `.dpr` |
360
375
  | php | | `.php` |
@@ -128,8 +128,8 @@ Use the cocoindex-code MCP server for semantic code search when:
128
128
  |----------|-------------|---------|
129
129
  | `COCOINDEX_CODE_ROOT_PATH` | Root path of the codebase | Auto-discovered (see below) |
130
130
  | `COCOINDEX_CODE_EMBEDDING_MODEL` | Embedding model (see below) | `sbert/sentence-transformers/all-MiniLM-L6-v2` |
131
- | `COCOINDEX_CODE_BATCH_SIZE` | Max batch size for local embedding model | `16` |
132
131
  | `COCOINDEX_CODE_EXTRA_EXTENSIONS` | Additional file extensions to index (comma-separated, e.g. `"inc:php,yaml,toml"` — use `ext:lang` to override language detection) | _(none)_ |
132
+ | `COCOINDEX_CODE_EXCLUDED_PATTERNS` | Additional glob patterns to exclude from indexing as a JSON array (e.g. `'["**/migration.sql", "{**/*.md,**/*.txt}"]'`) | _(none)_ |
133
133
 
134
134
 
135
135
  ### Root Path Discovery
@@ -262,14 +262,24 @@ claude mcp add cocoindex-code \
262
262
 
263
263
  Any model supported by LiteLLM works — see the [full list of embedding providers](https://docs.litellm.ai/docs/embedding/supported_embedding).
264
264
 
265
- ### GPU-optimised local model
265
+ ### Local SentenceTransformers models
266
266
 
267
- If you have a GPU, [`nomic-ai/CodeRankEmbed`](https://huggingface.co/nomic-ai/CodeRankEmbed) delivers significantly better code retrieval than the default model. It is 137M parameters, requires ~1 GB VRAM, and has an 8192-token context window.
267
+ Use the `sbert/` prefix to load any [SentenceTransformers](https://www.sbert.net/) model locally (no API key required).
268
+
269
+ **Example — general purpose text model:**
270
+ ```bash
271
+ claude mcp add cocoindex-code \
272
+ -e COCOINDEX_CODE_EMBEDDING_MODEL=sbert/nomic-ai/nomic-embed-text-v1 \
273
+ -- cocoindex-code
274
+ ```
275
+
276
+ **GPU-optimised code retrieval:**
277
+
278
+ [`nomic-ai/CodeRankEmbed`](https://huggingface.co/nomic-ai/CodeRankEmbed) delivers significantly better code retrieval than the default model. It is 137M parameters, requires ~1 GB VRAM, and has an 8192-token context window.
268
279
 
269
280
  ```bash
270
281
  claude mcp add cocoindex-code \
271
282
  -e COCOINDEX_CODE_EMBEDDING_MODEL=sbert/nomic-ai/CodeRankEmbed \
272
- -e COCOINDEX_CODE_BATCH_SIZE=16 \
273
283
  -- cocoindex-code
274
284
  ```
275
285
 
@@ -320,6 +330,7 @@ Returns matching code chunks with:
320
330
  | javascript | js | `.js` |
321
331
  | json | | `.json` |
322
332
  | kotlin | | `.kt`, `.kts` |
333
+ | lua | | `.lua` |
323
334
  | markdown | md | `.md`, `.mdx` |
324
335
  | pascal | pas, dpr, delphi | `.pas`, `.dpr` |
325
336
  | php | | `.php` |
@@ -23,12 +23,16 @@ classifiers = [
23
23
 
24
24
  dependencies = [
25
25
  "mcp>=1.0.0",
26
- "cocoindex[litellm]==1.0.0a28",
26
+ "cocoindex[litellm]==1.0.0a32",
27
27
  "sentence-transformers>=2.2.0",
28
28
  "sqlite-vec>=0.1.0",
29
29
  "pydantic>=2.0.0",
30
30
  "numpy>=1.24.0",
31
31
  "einops>=0.8.2",
32
+ "typer>=0.9.0",
33
+ "msgspec>=0.19.0",
34
+ "pathspec>=0.12.1",
35
+ "pyyaml>=6.0",
32
36
  ]
33
37
 
34
38
  [project.optional-dependencies]
@@ -43,6 +47,7 @@ dev = [
43
47
 
44
48
  [project.scripts]
45
49
  cocoindex-code = "cocoindex_code:main"
50
+ ccc = "cocoindex_code.cli:app"
46
51
 
47
52
  [project.urls]
48
53
  Homepage = "https://github.com/cocoindex-io/cocoindex-code"
@@ -51,6 +56,10 @@ Issues = "https://github.com/cocoindex-io/cocoindex-code/issues"
51
56
 
52
57
  [tool.hatch.version]
53
58
  source = "vcs"
59
+ fallback-version = "999.0.0"
60
+
61
+ [tool.hatch.build.hooks.vcs]
62
+ version-file = "src/cocoindex_code/_version.py"
54
63
 
55
64
  [tool.hatch.build.targets.wheel]
56
65
  packages = ["src/cocoindex_code"]
@@ -66,6 +75,7 @@ dev = [
66
75
  "ruff>=0.1.0",
67
76
  "mypy>=1.0.0",
68
77
  "prek>=0.1.0",
78
+ "types-pyyaml>=6.0.12.20250915",
69
79
  ]
70
80
 
71
81
  [tool.uv]
@@ -0,0 +1,10 @@
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__"]
@@ -0,0 +1,34 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '0.2.0'
32
+ __version_tuple__ = version_tuple = (0, 2, 0)
33
+
34
+ __commit_id__ = commit_id = None