mcp-vector-search 0.9.3__py3-none-any.whl → 0.12.1__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 mcp-vector-search might be problematic. Click here for more details.

@@ -1,7 +1,7 @@
1
1
  """MCP Vector Search - CLI-first semantic code search with MCP integration."""
2
2
 
3
- __version__ = "0.9.3"
4
- __build__ = "40"
3
+ __version__ = "0.12.1"
4
+ __build__ = "51"
5
5
  __author__ = "Robert Matsuoka"
6
6
  __email__ = "bobmatnyc@gmail.com"
7
7
 
@@ -67,6 +67,13 @@ def main(
67
67
  max=128,
68
68
  rich_help_panel="⚡ Performance",
69
69
  ),
70
+ debug: bool = typer.Option(
71
+ False,
72
+ "--debug",
73
+ "-d",
74
+ help="Enable debug output (shows hierarchy building details)",
75
+ rich_help_panel="🔍 Debugging",
76
+ ),
70
77
  ) -> None:
71
78
  """📑 Index your codebase for semantic search.
72
79
 
@@ -114,6 +121,7 @@ def main(
114
121
  force_reindex=force,
115
122
  batch_size=batch_size,
116
123
  show_progress=True,
124
+ debug=debug,
117
125
  )
118
126
  )
119
127
 
@@ -134,6 +142,7 @@ async def run_indexing(
134
142
  force_reindex: bool = False,
135
143
  batch_size: int = 32,
136
144
  show_progress: bool = True,
145
+ debug: bool = False,
137
146
  ) -> None:
138
147
  """Run the indexing process."""
139
148
  # Load project configuration
@@ -179,6 +188,7 @@ async def run_indexing(
179
188
  database=database,
180
189
  project_root=project_root,
181
190
  file_extensions=file_extensions,
191
+ debug=debug,
182
192
  )
183
193
 
184
194
  try:
@@ -324,19 +334,41 @@ async def _run_batch_indexing(
324
334
  )
325
335
  )
326
336
 
337
+ # Rebuild directory index after indexing completes
338
+ try:
339
+ import os
340
+
341
+ chunk_stats = {}
342
+ for file_path in files_to_index:
343
+ try:
344
+ mtime = os.path.getmtime(file_path)
345
+ chunk_stats[str(file_path)] = {
346
+ "modified": mtime,
347
+ "chunks": 1, # Placeholder - real counts are in database
348
+ }
349
+ except OSError:
350
+ pass
351
+
352
+ indexer.directory_index.rebuild_from_files(
353
+ files_to_index, indexer.project_root, chunk_stats=chunk_stats
354
+ )
355
+ indexer.directory_index.save()
356
+ except Exception as e:
357
+ logger.error(f"Failed to update directory index: {e}")
358
+
327
359
  # Final progress summary
328
360
  console.print()
329
361
  if failed_count > 0:
330
362
  console.print(
331
363
  f"[yellow]⚠ {failed_count} files failed to index[/yellow]"
332
364
  )
333
- error_log_path = indexer.project_root / ".mcp-vector-search" / "indexing_errors.log"
365
+ error_log_path = (
366
+ indexer.project_root / ".mcp-vector-search" / "indexing_errors.log"
367
+ )
334
368
  if error_log_path.exists():
335
369
  # Prune log to keep only last 1000 errors
336
370
  _prune_error_log(error_log_path, max_lines=1000)
337
- console.print(
338
- f"[dim] → See details in: {error_log_path}[/dim]"
339
- )
371
+ console.print(f"[dim] → See details in: {error_log_path}[/dim]")
340
372
  else:
341
373
  # Non-progress mode (fallback to original behavior)
342
374
  indexed_count = await indexer.index_project(
@@ -643,22 +675,10 @@ def watch_cmd(
643
675
  watch_app()
644
676
 
645
677
 
646
- @index_app.command("auto")
647
- def auto_cmd() -> None:
648
- """🔄 Manage automatic indexing.
649
-
650
- Configure automatic indexing strategies like git hooks and scheduled tasks.
651
- This command provides subcommands for setup, status, and checking.
652
-
653
- Examples:
654
- mcp-vector-search index auto setup
655
- mcp-vector-search index auto status
656
- mcp-vector-search index auto check
657
- """
658
- from .auto_index import auto_index_app
678
+ # Import and register auto-index sub-app as a proper typer group
679
+ from .auto_index import auto_index_app # noqa: E402
659
680
 
660
- # This will show help for the auto subcommands
661
- auto_index_app()
681
+ index_app.add_typer(auto_index_app, name="auto", help="🔄 Manage automatic indexing")
662
682
 
663
683
 
664
684
  @index_app.command("health")
@@ -702,17 +722,19 @@ def _prune_error_log(log_path: Path, max_lines: int = 1000) -> None:
702
722
  max_lines: Maximum number of lines to keep (default: 1000)
703
723
  """
704
724
  try:
705
- with open(log_path, 'r') as f:
725
+ with open(log_path) as f:
706
726
  lines = f.readlines()
707
727
 
708
728
  if len(lines) > max_lines:
709
729
  # Keep only the last max_lines lines
710
730
  pruned_lines = lines[-max_lines:]
711
731
 
712
- with open(log_path, 'w') as f:
732
+ with open(log_path, "w") as f:
713
733
  f.writelines(pruned_lines)
714
734
 
715
- logger.debug(f"Pruned error log from {len(lines)} to {len(pruned_lines)} lines")
735
+ logger.debug(
736
+ f"Pruned error log from {len(lines)} to {len(pruned_lines)} lines"
737
+ )
716
738
  except Exception as e:
717
739
  logger.warning(f"Failed to prune error log: {e}")
718
740