mcp-vector-search 0.7.4__py3-none-any.whl → 0.7.6__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.
- mcp_vector_search/__init__.py +2 -2
- mcp_vector_search/cli/commands/demo.py +2 -4
- mcp_vector_search/cli/commands/index.py +130 -30
- mcp_vector_search/cli/commands/mcp.py +673 -36
- mcp_vector_search/cli/commands/status.py +23 -9
- mcp_vector_search/cli/main.py +2 -4
- mcp_vector_search/core/database.py +117 -54
- mcp_vector_search/core/indexer.py +191 -15
- mcp_vector_search/core/project.py +6 -3
- mcp_vector_search/utils/gitignore.py +31 -23
- {mcp_vector_search-0.7.4.dist-info → mcp_vector_search-0.7.6.dist-info}/METADATA +1 -1
- {mcp_vector_search-0.7.4.dist-info → mcp_vector_search-0.7.6.dist-info}/RECORD +15 -15
- {mcp_vector_search-0.7.4.dist-info → mcp_vector_search-0.7.6.dist-info}/WHEEL +0 -0
- {mcp_vector_search-0.7.4.dist-info → mcp_vector_search-0.7.6.dist-info}/entry_points.txt +0 -0
- {mcp_vector_search-0.7.4.dist-info → mcp_vector_search-0.7.6.dist-info}/licenses/LICENSE +0 -0
mcp_vector_search/__init__.py
CHANGED
|
@@ -9,7 +9,7 @@ import typer
|
|
|
9
9
|
from loguru import logger
|
|
10
10
|
from rich.console import Console
|
|
11
11
|
|
|
12
|
-
from ..output import print_error, print_info, print_success
|
|
12
|
+
from ..output import print_error, print_info, print_success
|
|
13
13
|
|
|
14
14
|
console = Console()
|
|
15
15
|
|
|
@@ -321,9 +321,7 @@ class UserAPI:
|
|
|
321
321
|
console.print(" ✅ Automatic code indexing")
|
|
322
322
|
if not quick:
|
|
323
323
|
console.print(" ✅ Semantic code search in action")
|
|
324
|
-
console.print(
|
|
325
|
-
" ✅ Finding code by meaning (not just keywords)\n"
|
|
326
|
-
)
|
|
324
|
+
console.print(" ✅ Finding code by meaning (not just keywords)\n")
|
|
327
325
|
|
|
328
326
|
console.print("[bold cyan]Next steps to use in your project:[/bold cyan]")
|
|
329
327
|
console.print(" 1. [green]cd /your/project[/green]")
|
|
@@ -13,7 +13,6 @@ from ...core.exceptions import ProjectNotFoundError
|
|
|
13
13
|
from ...core.indexer import SemanticIndexer
|
|
14
14
|
from ...core.project import ProjectManager
|
|
15
15
|
from ..output import (
|
|
16
|
-
create_progress,
|
|
17
16
|
print_error,
|
|
18
17
|
print_index_stats,
|
|
19
18
|
print_info,
|
|
@@ -201,17 +200,138 @@ async def _run_batch_indexing(
|
|
|
201
200
|
) -> None:
|
|
202
201
|
"""Run batch indexing of all files."""
|
|
203
202
|
if show_progress:
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
# Import enhanced progress utilities
|
|
204
|
+
from rich.layout import Layout
|
|
205
|
+
from rich.live import Live
|
|
206
|
+
from rich.panel import Panel
|
|
207
|
+
from rich.progress import (
|
|
208
|
+
BarColumn,
|
|
209
|
+
Progress,
|
|
210
|
+
SpinnerColumn,
|
|
211
|
+
TextColumn,
|
|
212
|
+
TimeRemainingColumn,
|
|
213
|
+
)
|
|
214
|
+
from rich.table import Table
|
|
215
|
+
|
|
216
|
+
from ..output import console
|
|
217
|
+
|
|
218
|
+
# Pre-scan to get total file count
|
|
219
|
+
console.print("[dim]Scanning for indexable files...[/dim]")
|
|
220
|
+
indexable_files, files_to_index = await indexer.get_files_to_index(
|
|
221
|
+
force_reindex=force_reindex
|
|
222
|
+
)
|
|
223
|
+
total_files = len(files_to_index)
|
|
206
224
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
225
|
+
if total_files == 0:
|
|
226
|
+
console.print("[yellow]No files need indexing[/yellow]")
|
|
227
|
+
indexed_count = 0
|
|
228
|
+
else:
|
|
229
|
+
console.print(f"[dim]Found {total_files} files to index[/dim]\n")
|
|
230
|
+
|
|
231
|
+
# Track recently indexed files for display
|
|
232
|
+
recent_files = []
|
|
233
|
+
current_file_name = ""
|
|
234
|
+
indexed_count = 0
|
|
235
|
+
failed_count = 0
|
|
236
|
+
|
|
237
|
+
# Create layout for two-panel display
|
|
238
|
+
layout = Layout()
|
|
239
|
+
layout.split_column(
|
|
240
|
+
Layout(name="progress", size=4),
|
|
241
|
+
Layout(name="samples", size=7),
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
# Create progress bar
|
|
245
|
+
progress = Progress(
|
|
246
|
+
SpinnerColumn(),
|
|
247
|
+
TextColumn("[progress.description]{task.description}"),
|
|
248
|
+
BarColumn(bar_width=40),
|
|
249
|
+
TextColumn("[progress.percentage]{task.percentage:>3.0f}%"),
|
|
250
|
+
TextColumn("({task.completed}/{task.total} files)"),
|
|
251
|
+
TimeRemainingColumn(),
|
|
252
|
+
console=console,
|
|
211
253
|
)
|
|
212
254
|
|
|
213
|
-
progress.
|
|
255
|
+
task = progress.add_task("Indexing files...", total=total_files)
|
|
256
|
+
|
|
257
|
+
# Create live display with both panels
|
|
258
|
+
with Live(layout, console=console, refresh_per_second=4):
|
|
259
|
+
# Index files with progress updates
|
|
260
|
+
async for (
|
|
261
|
+
file_path,
|
|
262
|
+
chunks_added,
|
|
263
|
+
success,
|
|
264
|
+
) in indexer.index_files_with_progress(files_to_index, force_reindex):
|
|
265
|
+
# Update counts
|
|
266
|
+
if success:
|
|
267
|
+
indexed_count += 1
|
|
268
|
+
else:
|
|
269
|
+
failed_count += 1
|
|
270
|
+
|
|
271
|
+
# Update progress
|
|
272
|
+
progress.update(task, advance=1)
|
|
273
|
+
|
|
274
|
+
# Update current file name for display
|
|
275
|
+
current_file_name = file_path.name
|
|
276
|
+
|
|
277
|
+
# Keep last 5 files for sampling display
|
|
278
|
+
try:
|
|
279
|
+
relative_path = str(file_path.relative_to(indexer.project_root))
|
|
280
|
+
except ValueError:
|
|
281
|
+
relative_path = str(file_path)
|
|
282
|
+
|
|
283
|
+
recent_files.append((relative_path, chunks_added, success))
|
|
284
|
+
if len(recent_files) > 5:
|
|
285
|
+
recent_files.pop(0)
|
|
286
|
+
|
|
287
|
+
# Update display layouts
|
|
288
|
+
layout["progress"].update(
|
|
289
|
+
Panel(
|
|
290
|
+
progress,
|
|
291
|
+
title="[bold]Indexing Progress[/bold]",
|
|
292
|
+
border_style="blue",
|
|
293
|
+
)
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
# Build samples panel content
|
|
297
|
+
samples_table = Table.grid(expand=True)
|
|
298
|
+
samples_table.add_column(style="dim")
|
|
299
|
+
|
|
300
|
+
if current_file_name:
|
|
301
|
+
samples_table.add_row(
|
|
302
|
+
f"[bold cyan]Currently processing:[/bold cyan] {current_file_name}"
|
|
303
|
+
)
|
|
304
|
+
samples_table.add_row("")
|
|
305
|
+
|
|
306
|
+
samples_table.add_row("[dim]Recently indexed:[/dim]")
|
|
307
|
+
for rel_path, chunk_count, file_success in recent_files[-5:]:
|
|
308
|
+
icon = "✓" if file_success else "✗"
|
|
309
|
+
style = "green" if file_success else "red"
|
|
310
|
+
chunk_info = (
|
|
311
|
+
f"({chunk_count} chunks)"
|
|
312
|
+
if chunk_count > 0
|
|
313
|
+
else "(no chunks)"
|
|
314
|
+
)
|
|
315
|
+
samples_table.add_row(
|
|
316
|
+
f" [{style}]{icon}[/{style}] [cyan]{rel_path}[/cyan] [dim]{chunk_info}[/dim]"
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
layout["samples"].update(
|
|
320
|
+
Panel(
|
|
321
|
+
samples_table,
|
|
322
|
+
title="[bold]File Processing[/bold]",
|
|
323
|
+
border_style="dim",
|
|
324
|
+
)
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
# Final progress summary
|
|
328
|
+
console.print()
|
|
329
|
+
if failed_count > 0:
|
|
330
|
+
console.print(
|
|
331
|
+
f"[yellow]⚠ {failed_count} files failed to index[/yellow]"
|
|
332
|
+
)
|
|
214
333
|
else:
|
|
334
|
+
# Non-progress mode (fallback to original behavior)
|
|
215
335
|
indexed_count = await indexer.index_project(
|
|
216
336
|
force_reindex=force_reindex,
|
|
217
337
|
show_progress=show_progress,
|
|
@@ -374,28 +494,8 @@ async def _reindex_entire_project(project_root: Path) -> None:
|
|
|
374
494
|
print_info("Clearing existing index...")
|
|
375
495
|
await database.reset()
|
|
376
496
|
|
|
377
|
-
# Then reindex everything with progress
|
|
378
|
-
|
|
379
|
-
task = progress.add_task("Reindexing files...", total=None)
|
|
380
|
-
|
|
381
|
-
# Force reindex all files
|
|
382
|
-
indexed_count = await indexer.index_project(
|
|
383
|
-
force_reindex=True, # Force reindexing
|
|
384
|
-
show_progress=False, # We handle progress here
|
|
385
|
-
)
|
|
386
|
-
|
|
387
|
-
progress.update(task, completed=indexed_count, total=indexed_count)
|
|
388
|
-
|
|
389
|
-
# Show statistics
|
|
390
|
-
stats = await indexer.get_indexing_stats()
|
|
391
|
-
|
|
392
|
-
# Display success message with chunk count for clarity
|
|
393
|
-
total_chunks = stats.get("total_chunks", 0)
|
|
394
|
-
print_success(
|
|
395
|
-
f"Processed {indexed_count} files ({total_chunks} searchable chunks created)"
|
|
396
|
-
)
|
|
397
|
-
|
|
398
|
-
print_index_stats(stats)
|
|
497
|
+
# Then reindex everything with enhanced progress display
|
|
498
|
+
await _run_batch_indexing(indexer, force_reindex=True, show_progress=True)
|
|
399
499
|
|
|
400
500
|
except Exception as e:
|
|
401
501
|
logger.error(f"Full reindex error: {e}")
|