lmgrep 0.1.18 → 0.2.1
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.
- package/README.md +253 -62
- package/completions/_lmgrep +49 -40
- package/dist/application/Lmgrep.d.ts +107 -0
- package/dist/application/Lmgrep.js +99 -0
- package/dist/application/Lmgrep.js.map +1 -0
- package/dist/application/LmgrepFactory.d.ts +40 -0
- package/dist/application/LmgrepFactory.js +155 -0
- package/dist/application/LmgrepFactory.js.map +1 -0
- package/dist/application/indexing/BranchBootstrapper.d.ts +21 -0
- package/dist/application/indexing/BranchBootstrapper.js +52 -0
- package/dist/application/indexing/BranchBootstrapper.js.map +1 -0
- package/dist/application/indexing/BranchManifestSweeper.d.ts +17 -0
- package/dist/application/indexing/BranchManifestSweeper.js +35 -0
- package/dist/application/indexing/BranchManifestSweeper.js.map +1 -0
- package/dist/application/indexing/Duration.d.ts +9 -0
- package/dist/application/indexing/Duration.js +25 -0
- package/dist/application/indexing/Duration.js.map +1 -0
- package/dist/application/indexing/EmbeddingAbortError.d.ts +11 -0
- package/dist/application/indexing/EmbeddingAbortError.js +20 -0
- package/dist/application/indexing/EmbeddingAbortError.js.map +1 -0
- package/dist/application/indexing/EmbeddingPipeline.d.ts +59 -0
- package/dist/application/indexing/EmbeddingPipeline.js +140 -0
- package/dist/application/indexing/EmbeddingPipeline.js.map +1 -0
- package/dist/application/indexing/IndexBuilder.d.ts +112 -0
- package/dist/application/indexing/IndexBuilder.js +370 -0
- package/dist/application/indexing/IndexBuilder.js.map +1 -0
- package/dist/application/indexing/IndexingProgress.d.ts +34 -0
- package/dist/application/indexing/IndexingProgress.js +2 -0
- package/dist/application/indexing/IndexingProgress.js.map +1 -0
- package/dist/application/operations/Deadline.d.ts +13 -0
- package/dist/application/operations/Deadline.js +29 -0
- package/dist/application/operations/Deadline.js.map +1 -0
- package/dist/application/operations/HealthMonitor.d.ts +58 -0
- package/dist/application/operations/HealthMonitor.js +128 -0
- package/dist/application/operations/HealthMonitor.js.map +1 -0
- package/dist/application/operations/IndexAlternatives.d.ts +35 -0
- package/dist/application/operations/IndexAlternatives.js +61 -0
- package/dist/application/operations/IndexAlternatives.js.map +1 -0
- package/dist/application/operations/IndexInventory.d.ts +69 -0
- package/dist/application/operations/IndexInventory.js +99 -0
- package/dist/application/operations/IndexInventory.js.map +1 -0
- package/dist/application/operations/StatusService.d.ts +90 -0
- package/dist/application/operations/StatusService.js +171 -0
- package/dist/application/operations/StatusService.js.map +1 -0
- package/dist/application/operations/WatchService.d.ts +67 -0
- package/dist/application/operations/WatchService.js +145 -0
- package/dist/application/operations/WatchService.js.map +1 -0
- package/dist/application/operations/WorkingTreeDiff.d.ts +19 -0
- package/dist/application/operations/WorkingTreeDiff.js +36 -0
- package/dist/application/operations/WorkingTreeDiff.js.map +1 -0
- package/dist/application/research/ResearchAgent.d.ts +68 -0
- package/dist/application/research/ResearchAgent.js +201 -0
- package/dist/application/research/ResearchAgent.js.map +1 -0
- package/dist/application/research/ResearchPrompts.d.ts +16 -0
- package/dist/application/research/ResearchPrompts.js +34 -0
- package/dist/application/research/ResearchPrompts.js.map +1 -0
- package/dist/application/search/SearchCriteria.d.ts +37 -0
- package/dist/application/search/SearchCriteria.js +48 -0
- package/dist/application/search/SearchCriteria.js.map +1 -0
- package/dist/application/search/SearchService.d.ts +36 -0
- package/dist/application/search/SearchService.js +108 -0
- package/dist/application/search/SearchService.js.map +1 -0
- package/dist/application/search/SearchTargetResolver.d.ts +56 -0
- package/dist/application/search/SearchTargetResolver.js +104 -0
- package/dist/application/search/SearchTargetResolver.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +4 -953
- package/dist/cli.js.map +1 -1
- package/dist/domain/config/ConfigSource.d.ts +16 -0
- package/dist/domain/config/ConfigSource.js +2 -0
- package/dist/domain/config/ConfigSource.js.map +1 -0
- package/dist/domain/config/LmgrepConfig.d.ts +53 -0
- package/dist/domain/config/LmgrepConfig.js +2 -0
- package/dist/domain/config/LmgrepConfig.js.map +1 -0
- package/dist/domain/corpus/Chunk.d.ts +49 -0
- package/dist/domain/corpus/Chunk.js +60 -0
- package/dist/domain/corpus/Chunk.js.map +1 -0
- package/dist/domain/corpus/CodeLocation.d.ts +18 -0
- package/dist/domain/corpus/CodeLocation.js +34 -0
- package/dist/domain/corpus/CodeLocation.js.map +1 -0
- package/dist/domain/corpus/ContentHash.d.ts +15 -0
- package/dist/domain/corpus/ContentHash.js +30 -0
- package/dist/domain/corpus/ContentHash.js.map +1 -0
- package/dist/domain/corpus/FileVersion.d.ts +31 -0
- package/dist/domain/corpus/FileVersion.js +47 -0
- package/dist/domain/corpus/FileVersion.js.map +1 -0
- package/dist/domain/corpus/SourceFile.d.ts +26 -0
- package/dist/domain/corpus/SourceFile.js +47 -0
- package/dist/domain/corpus/SourceFile.js.map +1 -0
- package/dist/domain/corpus/Vector.d.ts +37 -0
- package/dist/domain/corpus/Vector.js +96 -0
- package/dist/domain/corpus/Vector.js.map +1 -0
- package/dist/domain/ports/ChatModelPort.d.ts +57 -0
- package/dist/domain/ports/ChatModelPort.js +2 -0
- package/dist/domain/ports/ChatModelPort.js.map +1 -0
- package/dist/domain/ports/ChunkRepositoryPort.d.ts +42 -0
- package/dist/domain/ports/ChunkRepositoryPort.js +2 -0
- package/dist/domain/ports/ChunkRepositoryPort.js.map +1 -0
- package/dist/domain/ports/ChunkerPort.d.ts +5 -0
- package/dist/domain/ports/ChunkerPort.js +2 -0
- package/dist/domain/ports/ChunkerPort.js.map +1 -0
- package/dist/domain/ports/DatabaseSessionPort.d.ts +10 -0
- package/dist/domain/ports/DatabaseSessionPort.js +2 -0
- package/dist/domain/ports/DatabaseSessionPort.js.map +1 -0
- package/dist/domain/ports/EmbedderPort.d.ts +14 -0
- package/dist/domain/ports/EmbedderPort.js +2 -0
- package/dist/domain/ports/EmbedderPort.js.map +1 -0
- package/dist/domain/ports/FileManifestRepositoryPort.d.ts +32 -0
- package/dist/domain/ports/FileManifestRepositoryPort.js +2 -0
- package/dist/domain/ports/FileManifestRepositoryPort.js.map +1 -0
- package/dist/domain/ports/GitPort.d.ts +24 -0
- package/dist/domain/ports/GitPort.js +2 -0
- package/dist/domain/ports/GitPort.js.map +1 -0
- package/dist/domain/ports/IndexMaintenancePort.d.ts +58 -0
- package/dist/domain/ports/IndexMaintenancePort.js +2 -0
- package/dist/domain/ports/IndexMaintenancePort.js.map +1 -0
- package/dist/domain/ports/IndexMetadataPort.d.ts +23 -0
- package/dist/domain/ports/IndexMetadataPort.js +2 -0
- package/dist/domain/ports/IndexMetadataPort.js.map +1 -0
- package/dist/domain/ports/LockPort.d.ts +17 -0
- package/dist/domain/ports/LockPort.js +2 -0
- package/dist/domain/ports/LockPort.js.map +1 -0
- package/dist/domain/ports/LoggerPort.d.ts +5 -0
- package/dist/domain/ports/LoggerPort.js +2 -0
- package/dist/domain/ports/LoggerPort.js.map +1 -0
- package/dist/domain/ports/ProjectIndexesPort.d.ts +20 -0
- package/dist/domain/ports/ProjectIndexesPort.js +2 -0
- package/dist/domain/ports/ProjectIndexesPort.js.map +1 -0
- package/dist/domain/ports/ProjectRegistryPort.d.ts +42 -0
- package/dist/domain/ports/ProjectRegistryPort.js +2 -0
- package/dist/domain/ports/ProjectRegistryPort.js.map +1 -0
- package/dist/domain/ports/StateDirectoryPort.d.ts +29 -0
- package/dist/domain/ports/StateDirectoryPort.js +2 -0
- package/dist/domain/ports/StateDirectoryPort.js.map +1 -0
- package/dist/domain/ports/WorkspacePort.d.ts +38 -0
- package/dist/domain/ports/WorkspacePort.js +2 -0
- package/dist/domain/ports/WorkspacePort.js.map +1 -0
- package/dist/domain/project/Branch.d.ts +20 -0
- package/dist/domain/project/Branch.js +33 -0
- package/dist/domain/project/Branch.js.map +1 -0
- package/dist/domain/project/DatabaseLocation.d.ts +32 -0
- package/dist/domain/project/DatabaseLocation.js +35 -0
- package/dist/domain/project/DatabaseLocation.js.map +1 -0
- package/dist/domain/project/IndexMetadata.d.ts +17 -0
- package/dist/domain/project/IndexMetadata.js +2 -0
- package/dist/domain/project/IndexMetadata.js.map +1 -0
- package/dist/domain/project/ModelIdentity.d.ts +58 -0
- package/dist/domain/project/ModelIdentity.js +94 -0
- package/dist/domain/project/ModelIdentity.js.map +1 -0
- package/dist/domain/project/Project.d.ts +17 -0
- package/dist/domain/project/Project.js +21 -0
- package/dist/domain/project/Project.js.map +1 -0
- package/dist/domain/project/ProjectId.d.ts +28 -0
- package/dist/domain/project/ProjectId.js +58 -0
- package/dist/domain/project/ProjectId.js.map +1 -0
- package/dist/domain/project/ProjectLocator.d.ts +112 -0
- package/dist/domain/project/ProjectLocator.js +178 -0
- package/dist/domain/project/ProjectLocator.js.map +1 -0
- package/dist/domain/research/Citation.d.ts +27 -0
- package/dist/domain/research/Citation.js +43 -0
- package/dist/domain/research/Citation.js.map +1 -0
- package/dist/domain/research/EvidenceLedger.d.ts +47 -0
- package/dist/domain/research/EvidenceLedger.js +111 -0
- package/dist/domain/research/EvidenceLedger.js.map +1 -0
- package/dist/domain/research/ResearchTrace.d.ts +19 -0
- package/dist/domain/research/ResearchTrace.js +22 -0
- package/dist/domain/research/ResearchTrace.js.map +1 -0
- package/dist/domain/retrieval/Hit.d.ts +19 -0
- package/dist/domain/retrieval/Hit.js +28 -0
- package/dist/domain/retrieval/Hit.js.map +1 -0
- package/dist/domain/retrieval/HitList.d.ts +35 -0
- package/dist/domain/retrieval/HitList.js +81 -0
- package/dist/domain/retrieval/HitList.js.map +1 -0
- package/dist/domain/retrieval/MissingIndexError.d.ts +11 -0
- package/dist/domain/retrieval/MissingIndexError.js +15 -0
- package/dist/domain/retrieval/MissingIndexError.js.map +1 -0
- package/dist/index.d.ts +43 -45
- package/dist/index.js +30 -567
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/AiSdkChatModel.d.ts +31 -0
- package/dist/infrastructure/ai/AiSdkChatModel.js +137 -0
- package/dist/infrastructure/ai/AiSdkChatModel.js.map +1 -0
- package/dist/infrastructure/ai/AiSdkEmbedder.d.ts +28 -0
- package/dist/infrastructure/ai/AiSdkEmbedder.js +79 -0
- package/dist/infrastructure/ai/AiSdkEmbedder.js.map +1 -0
- package/dist/infrastructure/ai/DockerModelRunnerProbe.d.ts +16 -0
- package/dist/infrastructure/ai/DockerModelRunnerProbe.js +52 -0
- package/dist/infrastructure/ai/DockerModelRunnerProbe.js.map +1 -0
- package/dist/infrastructure/ai/EmbeddingPrefixes.d.ts +21 -0
- package/dist/infrastructure/ai/EmbeddingPrefixes.js +40 -0
- package/dist/infrastructure/ai/EmbeddingPrefixes.js.map +1 -0
- package/dist/infrastructure/ai/LmStudioProbe.d.ts +18 -0
- package/dist/infrastructure/ai/LmStudioProbe.js +49 -0
- package/dist/infrastructure/ai/LmStudioProbe.js.map +1 -0
- package/dist/infrastructure/ai/LocalModelReloader.d.ts +21 -0
- package/dist/infrastructure/ai/LocalModelReloader.js +61 -0
- package/dist/infrastructure/ai/LocalModelReloader.js.map +1 -0
- package/dist/infrastructure/ai/LocalRuntimeDetector.d.ts +36 -0
- package/dist/infrastructure/ai/LocalRuntimeDetector.js +63 -0
- package/dist/infrastructure/ai/LocalRuntimeDetector.js.map +1 -0
- package/dist/infrastructure/ai/ModelRuntime.d.ts +32 -0
- package/dist/infrastructure/ai/ModelRuntime.js +2 -0
- package/dist/infrastructure/ai/ModelRuntime.js.map +1 -0
- package/dist/infrastructure/ai/OllamaProbe.d.ts +22 -0
- package/dist/infrastructure/ai/OllamaProbe.js +71 -0
- package/dist/infrastructure/ai/OllamaProbe.js.map +1 -0
- package/dist/infrastructure/ai/ProviderFailure.d.ts +16 -0
- package/dist/infrastructure/ai/ProviderFailure.js +35 -0
- package/dist/infrastructure/ai/ProviderFailure.js.map +1 -0
- package/dist/infrastructure/ai/ProviderModuleLoader.d.ts +14 -0
- package/dist/infrastructure/ai/ProviderModuleLoader.js +56 -0
- package/dist/infrastructure/ai/ProviderModuleLoader.js.map +1 -0
- package/dist/infrastructure/ai/ProviderRegistry.d.ts +38 -0
- package/dist/infrastructure/ai/ProviderRegistry.js +63 -0
- package/dist/infrastructure/ai/ProviderRegistry.js.map +1 -0
- package/dist/infrastructure/fs/ConfigLoader.d.ts +59 -0
- package/dist/infrastructure/fs/ConfigLoader.js +194 -0
- package/dist/infrastructure/fs/ConfigLoader.js.map +1 -0
- package/dist/infrastructure/fs/DatabaseLocks.d.ts +52 -0
- package/dist/infrastructure/fs/DatabaseLocks.js +92 -0
- package/dist/infrastructure/fs/DatabaseLocks.js.map +1 -0
- package/dist/infrastructure/fs/DiskUsage.d.ts +6 -0
- package/dist/infrastructure/fs/DiskUsage.js +41 -0
- package/dist/infrastructure/fs/DiskUsage.js.map +1 -0
- package/dist/infrastructure/fs/IndexableFileRules.d.ts +33 -0
- package/dist/infrastructure/fs/IndexableFileRules.js +177 -0
- package/dist/infrastructure/fs/IndexableFileRules.js.map +1 -0
- package/dist/infrastructure/fs/Loggers.d.ts +14 -0
- package/dist/infrastructure/fs/Loggers.js +18 -0
- package/dist/infrastructure/fs/Loggers.js.map +1 -0
- package/dist/infrastructure/fs/PidFileLock.d.ts +40 -0
- package/dist/infrastructure/fs/PidFileLock.js +97 -0
- package/dist/infrastructure/fs/PidFileLock.js.map +1 -0
- package/dist/infrastructure/fs/ProjectIndexes.d.ts +8 -0
- package/dist/infrastructure/fs/ProjectIndexes.js +35 -0
- package/dist/infrastructure/fs/ProjectIndexes.js.map +1 -0
- package/dist/infrastructure/fs/ProjectMetadataStore.d.ts +42 -0
- package/dist/infrastructure/fs/ProjectMetadataStore.js +86 -0
- package/dist/infrastructure/fs/ProjectMetadataStore.js.map +1 -0
- package/dist/infrastructure/fs/ProjectRegistry.d.ts +25 -0
- package/dist/infrastructure/fs/ProjectRegistry.js +83 -0
- package/dist/infrastructure/fs/ProjectRegistry.js.map +1 -0
- package/dist/infrastructure/fs/StateDirectory.d.ts +28 -0
- package/dist/infrastructure/fs/StateDirectory.js +71 -0
- package/dist/infrastructure/fs/StateDirectory.js.map +1 -0
- package/dist/infrastructure/fs/Workspace.d.ts +25 -0
- package/dist/infrastructure/fs/Workspace.js +90 -0
- package/dist/infrastructure/fs/Workspace.js.map +1 -0
- package/dist/infrastructure/git/GitClient.d.ts +34 -0
- package/dist/infrastructure/git/GitClient.js +74 -0
- package/dist/infrastructure/git/GitClient.js.map +1 -0
- package/dist/infrastructure/lancedb/ChunkRepository.d.ts +38 -0
- package/dist/infrastructure/lancedb/ChunkRepository.js +166 -0
- package/dist/infrastructure/lancedb/ChunkRepository.js.map +1 -0
- package/dist/infrastructure/lancedb/DatabaseImporter.d.ts +22 -0
- package/dist/infrastructure/lancedb/DatabaseImporter.js +74 -0
- package/dist/infrastructure/lancedb/DatabaseImporter.js.map +1 -0
- package/dist/infrastructure/lancedb/FileManifestRepository.d.ts +34 -0
- package/dist/infrastructure/lancedb/FileManifestRepository.js +137 -0
- package/dist/infrastructure/lancedb/FileManifestRepository.js.map +1 -0
- package/dist/infrastructure/lancedb/IndexMaintenance.d.ts +53 -0
- package/dist/infrastructure/lancedb/IndexMaintenance.js +227 -0
- package/dist/infrastructure/lancedb/IndexMaintenance.js.map +1 -0
- package/dist/infrastructure/lancedb/LanceTables.d.ts +67 -0
- package/dist/infrastructure/lancedb/LanceTables.js +159 -0
- package/dist/infrastructure/lancedb/LanceTables.js.map +1 -0
- package/dist/{lib/native-tuning.js → infrastructure/lancedb/NativeTuning.js} +1 -1
- package/dist/infrastructure/lancedb/NativeTuning.js.map +1 -0
- package/dist/infrastructure/lancedb/RowReplication.d.ts +27 -0
- package/dist/infrastructure/lancedb/RowReplication.js +82 -0
- package/dist/infrastructure/lancedb/RowReplication.js.map +1 -0
- package/dist/infrastructure/lancedb/VectorIndexPolicy.d.ts +60 -0
- package/dist/infrastructure/lancedb/VectorIndexPolicy.js +72 -0
- package/dist/infrastructure/lancedb/VectorIndexPolicy.js.map +1 -0
- package/dist/infrastructure/p2p/IndexShare.d.ts +45 -0
- package/dist/infrastructure/p2p/IndexShare.js +160 -0
- package/dist/infrastructure/p2p/IndexShare.js.map +1 -0
- package/dist/infrastructure/p2p/PeerSwarm.d.ts +16 -0
- package/dist/infrastructure/p2p/PeerSwarm.js +41 -0
- package/dist/infrastructure/p2p/PeerSwarm.js.map +1 -0
- package/dist/infrastructure/p2p/SecureChannel.d.ts +60 -0
- package/dist/infrastructure/p2p/SecureChannel.js +71 -0
- package/dist/infrastructure/p2p/SecureChannel.js.map +1 -0
- package/dist/infrastructure/p2p/ShareCode.d.ts +25 -0
- package/dist/infrastructure/p2p/ShareCode.js +304 -0
- package/dist/infrastructure/p2p/ShareCode.js.map +1 -0
- package/dist/infrastructure/process/ProcessRegistry.d.ts +50 -0
- package/dist/infrastructure/process/ProcessRegistry.js +109 -0
- package/dist/infrastructure/process/ProcessRegistry.js.map +1 -0
- package/dist/infrastructure/treesitter/ChunkContextBuilder.d.ts +45 -0
- package/dist/infrastructure/treesitter/ChunkContextBuilder.js +159 -0
- package/dist/infrastructure/treesitter/ChunkContextBuilder.js.map +1 -0
- package/dist/infrastructure/treesitter/EmbeddedTreeSitterAssets.d.ts +8 -0
- package/dist/infrastructure/treesitter/EmbeddedTreeSitterAssets.js +12 -0
- package/dist/infrastructure/treesitter/EmbeddedTreeSitterAssets.js.map +1 -0
- package/dist/infrastructure/treesitter/LanguageCatalog.d.ts +30 -0
- package/dist/{lib/chunker/languages.js → infrastructure/treesitter/LanguageCatalog.js} +38 -29
- package/dist/infrastructure/treesitter/LanguageCatalog.js.map +1 -0
- package/dist/infrastructure/treesitter/SlidingWindowChunker.d.ts +15 -0
- package/dist/infrastructure/treesitter/SlidingWindowChunker.js +42 -0
- package/dist/infrastructure/treesitter/SlidingWindowChunker.js.map +1 -0
- package/dist/infrastructure/treesitter/TreeSitterChunker.d.ts +42 -0
- package/dist/infrastructure/treesitter/TreeSitterChunker.js +165 -0
- package/dist/infrastructure/treesitter/TreeSitterChunker.js.map +1 -0
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +14 -72
- package/dist/mcp.js.map +1 -1
- package/dist/presentation/cli/Cli.d.ts +31 -0
- package/dist/presentation/cli/Cli.js +120 -0
- package/dist/presentation/cli/Cli.js.map +1 -0
- package/dist/presentation/cli/CliOptions.d.ts +18 -0
- package/dist/presentation/cli/CliOptions.js +25 -0
- package/dist/presentation/cli/CliOptions.js.map +1 -0
- package/dist/presentation/cli/CommandContext.d.ts +50 -0
- package/dist/presentation/cli/CommandContext.js +88 -0
- package/dist/presentation/cli/CommandContext.js.map +1 -0
- package/dist/presentation/cli/ConfigTemplate.d.ts +31 -0
- package/dist/presentation/cli/ConfigTemplate.js +83 -0
- package/dist/presentation/cli/ConfigTemplate.js.map +1 -0
- package/dist/presentation/cli/Renderer.d.ts +90 -0
- package/dist/presentation/cli/Renderer.js +290 -0
- package/dist/presentation/cli/Renderer.js.map +1 -0
- package/dist/presentation/cli/commands/AskCommand.d.ts +14 -0
- package/dist/presentation/cli/commands/AskCommand.js +48 -0
- package/dist/presentation/cli/commands/AskCommand.js.map +1 -0
- package/dist/presentation/cli/commands/CompletionsCommand.d.ts +18 -0
- package/dist/presentation/cli/commands/CompletionsCommand.js +96 -0
- package/dist/presentation/cli/commands/CompletionsCommand.js.map +1 -0
- package/dist/presentation/cli/commands/ConfigCommands.d.ts +56 -0
- package/dist/presentation/cli/commands/ConfigCommands.js +220 -0
- package/dist/presentation/cli/commands/ConfigCommands.js.map +1 -0
- package/dist/presentation/cli/commands/IndexCommand.d.ts +18 -0
- package/dist/presentation/cli/commands/IndexCommand.js +54 -0
- package/dist/presentation/cli/commands/IndexCommand.js.map +1 -0
- package/dist/presentation/cli/commands/ProjectsCommand.d.ts +48 -0
- package/dist/presentation/cli/commands/ProjectsCommand.js +240 -0
- package/dist/presentation/cli/commands/ProjectsCommand.js.map +1 -0
- package/dist/presentation/cli/commands/SearchCommand.d.ts +19 -0
- package/dist/presentation/cli/commands/SearchCommand.js +55 -0
- package/dist/presentation/cli/commands/SearchCommand.js.map +1 -0
- package/dist/presentation/cli/commands/ServerCommands.d.ts +13 -0
- package/dist/presentation/cli/commands/ServerCommands.js +40 -0
- package/dist/presentation/cli/commands/ServerCommands.js.map +1 -0
- package/dist/presentation/cli/commands/ShareCommands.d.ts +22 -0
- package/dist/presentation/cli/commands/ShareCommands.js +134 -0
- package/dist/presentation/cli/commands/ShareCommands.js.map +1 -0
- package/dist/presentation/cli/commands/StatusCommand.d.ts +15 -0
- package/dist/presentation/cli/commands/StatusCommand.js +53 -0
- package/dist/presentation/cli/commands/StatusCommand.js.map +1 -0
- package/dist/presentation/mcp/HitFormatter.d.ts +17 -0
- package/dist/presentation/mcp/HitFormatter.js +42 -0
- package/dist/presentation/mcp/HitFormatter.js.map +1 -0
- package/dist/presentation/mcp/IndexWatchController.d.ts +17 -0
- package/dist/presentation/mcp/IndexWatchController.js +31 -0
- package/dist/presentation/mcp/IndexWatchController.js.map +1 -0
- package/dist/presentation/mcp/LmgrepCore.d.ts +66 -0
- package/dist/presentation/mcp/LmgrepCore.js +178 -0
- package/dist/presentation/mcp/LmgrepCore.js.map +1 -0
- package/dist/presentation/mcp/McpServer.d.ts +18 -0
- package/dist/presentation/mcp/McpServer.js +63 -0
- package/dist/presentation/mcp/McpServer.js.map +1 -0
- package/dist/presentation/mcp/ToolDescriptions.d.ts +40 -0
- package/dist/presentation/mcp/ToolDescriptions.js +85 -0
- package/dist/presentation/mcp/ToolDescriptions.js.map +1 -0
- package/package.json +93 -89
- package/dist/lib/build.d.ts +0 -21
- package/dist/lib/build.js +0 -374
- package/dist/lib/build.js.map +0 -1
- package/dist/lib/chunker/context.d.ts +0 -21
- package/dist/lib/chunker/context.js +0 -131
- package/dist/lib/chunker/context.js.map +0 -1
- package/dist/lib/chunker/index.d.ts +0 -7
- package/dist/lib/chunker/index.js +0 -209
- package/dist/lib/chunker/index.js.map +0 -1
- package/dist/lib/chunker/languages.d.ts +0 -15
- package/dist/lib/chunker/languages.js.map +0 -1
- package/dist/lib/config.d.ts +0 -12
- package/dist/lib/config.js +0 -83
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/embedder.d.ts +0 -65
- package/dist/lib/embedder.js +0 -236
- package/dist/lib/embedder.js.map +0 -1
- package/dist/lib/facet-session.d.ts +0 -44
- package/dist/lib/facet-session.js +0 -125
- package/dist/lib/facet-session.js.map +0 -1
- package/dist/lib/native-tuning.js.map +0 -1
- package/dist/lib/p2p.d.ts +0 -32
- package/dist/lib/p2p.js +0 -281
- package/dist/lib/p2p.js.map +0 -1
- package/dist/lib/providers.d.ts +0 -1
- package/dist/lib/providers.js +0 -41
- package/dist/lib/providers.js.map +0 -1
- package/dist/lib/repair.d.ts +0 -10
- package/dist/lib/repair.js +0 -57
- package/dist/lib/repair.js.map +0 -1
- package/dist/lib/scanner.d.ts +0 -34
- package/dist/lib/scanner.js +0 -242
- package/dist/lib/scanner.js.map +0 -1
- package/dist/lib/search-tool.d.ts +0 -55
- package/dist/lib/search-tool.js +0 -319
- package/dist/lib/search-tool.js.map +0 -1
- package/dist/lib/serve.d.ts +0 -11
- package/dist/lib/serve.js +0 -144
- package/dist/lib/serve.js.map +0 -1
- package/dist/lib/store.d.ts +0 -252
- package/dist/lib/store.js +0 -1216
- package/dist/lib/store.js.map +0 -1
- package/dist/lib/types.d.ts +0 -194
- package/dist/lib/types.js +0 -13
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/vocab.d.ts +0 -20
- package/dist/lib/vocab.js +0 -275
- package/dist/lib/vocab.js.map +0 -1
- /package/dist/{lib/native-tuning.d.ts → infrastructure/lancedb/NativeTuning.d.ts} +0 -0
package/dist/lib/repair.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { hashFile, walkFiles } from "./scanner.js";
|
|
2
|
-
import { consoleLogger } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Reconcile the current-branch file manifest with the working tree.
|
|
5
|
-
* Any manifest row whose path is missing from disk, or whose stored hash
|
|
6
|
-
* disagrees with the on-disk hash, is removed. Chunks for those paths are
|
|
7
|
-
* deleted too (guarded cross-branch inside the store). The next
|
|
8
|
-
* `lmgrep index` run will then treat those files as additions and re-embed.
|
|
9
|
-
*/
|
|
10
|
-
export async function repair(cwd, store, dry = false, logger = consoleLogger) {
|
|
11
|
-
const log = logger.info.bind(logger);
|
|
12
|
-
log("Reconciling current-branch manifest with working tree...");
|
|
13
|
-
const chunkCountBefore = await store.chunkCount();
|
|
14
|
-
const storedFileHashes = await store.getFileHashes();
|
|
15
|
-
const diskFiles = new Set(walkFiles(cwd));
|
|
16
|
-
const orphaned = [];
|
|
17
|
-
const stale = [];
|
|
18
|
-
for (const [fp, storedHash] of storedFileHashes) {
|
|
19
|
-
if (!diskFiles.has(fp)) {
|
|
20
|
-
orphaned.push(fp);
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
const currentHash = hashFile(cwd, fp);
|
|
24
|
-
if (currentHash === undefined) {
|
|
25
|
-
orphaned.push(fp);
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
if (currentHash !== storedHash)
|
|
29
|
-
stale.push(fp);
|
|
30
|
-
}
|
|
31
|
-
const total = orphaned.length + stale.length;
|
|
32
|
-
if (total === 0) {
|
|
33
|
-
log("Manifest matches working tree. No repairs needed.");
|
|
34
|
-
return { orphaned: [], stale: [], chunksRemoved: 0 };
|
|
35
|
-
}
|
|
36
|
-
log(`Found ${total} inconsistencies:`);
|
|
37
|
-
if (orphaned.length > 0)
|
|
38
|
-
log(` ${orphaned.length} orphaned files`);
|
|
39
|
-
if (stale.length > 0)
|
|
40
|
-
log(` ${stale.length} stale files`);
|
|
41
|
-
if (dry) {
|
|
42
|
-
for (const fp of orphaned)
|
|
43
|
-
log(` [orphan] ${fp}`);
|
|
44
|
-
for (const fp of stale)
|
|
45
|
-
log(` [stale] ${fp}`);
|
|
46
|
-
return { orphaned, stale, chunksRemoved: 0 };
|
|
47
|
-
}
|
|
48
|
-
const toDrop = [...orphaned, ...stale];
|
|
49
|
-
await store.deleteChunksByFiles(toDrop);
|
|
50
|
-
await store.deleteFileHashes(toDrop);
|
|
51
|
-
const chunkCountAfter = await store.chunkCount();
|
|
52
|
-
const chunksRemoved = chunkCountBefore - chunkCountAfter;
|
|
53
|
-
log(`Dropped ${toDrop.length} manifest entries (${chunksRemoved} chunks removed). ` +
|
|
54
|
-
`Run \`lmgrep index\` to re-embed stale files.`);
|
|
55
|
-
return { orphaned, stale, chunksRemoved };
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=repair.js.map
|
package/dist/lib/repair.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../../src/lib/repair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC3B,GAAW,EACX,KAAY,EACZ,GAAG,GAAG,KAAK,EACX,SAAiB,aAAa;IAE9B,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,GAAG,CAAC,0DAA0D,CAAC,CAAC;IAEhE,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,CAAC;IAClD,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;IACrD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,gBAAgB,EAAE,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,C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AC;IACxC,MAAM,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAErC,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,CAAC;IACjD,MAAM,aAAa,GAAG,gBAAgB,GAAG,eAAe,CAAC;IAEzD,GAAG,CACF,WAAW,MAAM,CAAC,MAAM,sBAAsB,aAAa,oBAAoB;QAC9E,+CAA+C,CAChD,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAC3C,CAAC"}
|
package/dist/lib/scanner.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { FileEntry } from "./types.js";
|
|
2
|
-
export declare const DEFAULT_IGNORE: string[];
|
|
3
|
-
export declare const CODE_EXTENSIONS: Set<string>;
|
|
4
|
-
export interface ExtensionConfig {
|
|
5
|
-
include?: string[];
|
|
6
|
-
exclude?: string[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Walk the directory tree and yield file entries.
|
|
10
|
-
* Reads nested .gitignore files at each directory level.
|
|
11
|
-
*/
|
|
12
|
-
export declare function walkFiles(cwd: string, extraIgnore?: string[], extensions?: ExtensionConfig): string[];
|
|
13
|
-
/**
|
|
14
|
-
* Hash a file's content for change detection.
|
|
15
|
-
*/
|
|
16
|
-
export declare function hashFile(cwd: string, filePath: string): string | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* Compute changed files by comparing disk hashes against stored hashes.
|
|
19
|
-
*/
|
|
20
|
-
export declare function detectChanges(files: string[], storedHashes: Map<string, string>, cwd: string, force?: boolean): {
|
|
21
|
-
changed: FileEntry[];
|
|
22
|
-
currentHashes: Map<string, string>;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Filter files by modification time.
|
|
26
|
-
*/
|
|
27
|
-
export declare function filterByMtime(files: string[], cwd: string, cutoffMs: number): string[];
|
|
28
|
-
/**
|
|
29
|
-
* Watch a directory for code file changes. Calls the callback with debouncing.
|
|
30
|
-
* Collects changed file paths during the debounce window and passes them to the callback.
|
|
31
|
-
*/
|
|
32
|
-
export declare function watchFiles(cwd: string, extraIgnore: string[] | undefined, onChanges: (changedFiles: string[]) => void, debounceMs?: number, extensions?: ExtensionConfig): {
|
|
33
|
-
close: () => void;
|
|
34
|
-
};
|
package/dist/lib/scanner.js
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { readFileSync, existsSync, watch, statSync } from "node:fs";
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { join, extname, dirname } from "node:path";
|
|
4
|
-
import { globSync } from "glob";
|
|
5
|
-
import ignore from "ignore";
|
|
6
|
-
export const DEFAULT_IGNORE = [
|
|
7
|
-
"node_modules",
|
|
8
|
-
".git",
|
|
9
|
-
"dist",
|
|
10
|
-
"build",
|
|
11
|
-
".next",
|
|
12
|
-
"__pycache__",
|
|
13
|
-
".venv",
|
|
14
|
-
"vendor",
|
|
15
|
-
"target",
|
|
16
|
-
".lmgrep",
|
|
17
|
-
"*.min.js",
|
|
18
|
-
"*.min.css",
|
|
19
|
-
"*.map",
|
|
20
|
-
"*.lock",
|
|
21
|
-
"pnpm-lock.yaml",
|
|
22
|
-
"package-lock.json",
|
|
23
|
-
"yarn.lock",
|
|
24
|
-
"*.png",
|
|
25
|
-
"*.jpg",
|
|
26
|
-
"*.jpeg",
|
|
27
|
-
"*.gif",
|
|
28
|
-
"*.ico",
|
|
29
|
-
"*.woff",
|
|
30
|
-
"*.woff2",
|
|
31
|
-
"*.ttf",
|
|
32
|
-
"*.eot",
|
|
33
|
-
"*.svg",
|
|
34
|
-
"*.zip",
|
|
35
|
-
"*.tar",
|
|
36
|
-
"*.gz",
|
|
37
|
-
"*.bin",
|
|
38
|
-
"*.exe",
|
|
39
|
-
"*.dll",
|
|
40
|
-
"*.so",
|
|
41
|
-
"*.dylib",
|
|
42
|
-
"*.wasm",
|
|
43
|
-
];
|
|
44
|
-
export const CODE_EXTENSIONS = new Set([
|
|
45
|
-
".js",
|
|
46
|
-
".ts",
|
|
47
|
-
".jsx",
|
|
48
|
-
".tsx",
|
|
49
|
-
".py",
|
|
50
|
-
".rs",
|
|
51
|
-
".go",
|
|
52
|
-
".rb",
|
|
53
|
-
".c",
|
|
54
|
-
".h",
|
|
55
|
-
".cpp",
|
|
56
|
-
".hpp",
|
|
57
|
-
".cc",
|
|
58
|
-
".swift",
|
|
59
|
-
".json",
|
|
60
|
-
".yaml",
|
|
61
|
-
".yml",
|
|
62
|
-
".toml",
|
|
63
|
-
".lua",
|
|
64
|
-
".scala",
|
|
65
|
-
".zig",
|
|
66
|
-
".md",
|
|
67
|
-
".markdown",
|
|
68
|
-
".mdx",
|
|
69
|
-
".sh",
|
|
70
|
-
".bash",
|
|
71
|
-
".sql",
|
|
72
|
-
".graphql",
|
|
73
|
-
".gql",
|
|
74
|
-
".proto",
|
|
75
|
-
".html",
|
|
76
|
-
".css",
|
|
77
|
-
".scss",
|
|
78
|
-
".vue",
|
|
79
|
-
".svelte",
|
|
80
|
-
".nix",
|
|
81
|
-
".tf",
|
|
82
|
-
".hcl",
|
|
83
|
-
".kt",
|
|
84
|
-
".java",
|
|
85
|
-
".php",
|
|
86
|
-
".cs",
|
|
87
|
-
".rst",
|
|
88
|
-
".adoc",
|
|
89
|
-
]);
|
|
90
|
-
function buildExtensionSet(config) {
|
|
91
|
-
const exts = new Set(CODE_EXTENSIONS);
|
|
92
|
-
if (config?.include) {
|
|
93
|
-
for (const ext of config.include)
|
|
94
|
-
exts.add(ext);
|
|
95
|
-
}
|
|
96
|
-
if (config?.exclude) {
|
|
97
|
-
for (const ext of config.exclude)
|
|
98
|
-
exts.delete(ext);
|
|
99
|
-
}
|
|
100
|
-
return exts;
|
|
101
|
-
}
|
|
102
|
-
function isCodeFile(filePath, exts) {
|
|
103
|
-
const ext = extname(filePath);
|
|
104
|
-
return exts.has(ext);
|
|
105
|
-
}
|
|
106
|
-
function buildIgnoreFilter(cwd, extraPatterns) {
|
|
107
|
-
const ig = ignore();
|
|
108
|
-
ig.add(DEFAULT_IGNORE);
|
|
109
|
-
if (extraPatterns) {
|
|
110
|
-
ig.add(extraPatterns);
|
|
111
|
-
}
|
|
112
|
-
const gitignorePath = join(cwd, ".gitignore");
|
|
113
|
-
if (existsSync(gitignorePath)) {
|
|
114
|
-
ig.add(readFileSync(gitignorePath, "utf-8"));
|
|
115
|
-
}
|
|
116
|
-
const lmgrepIgnorePath = join(cwd, ".lmgrepignore");
|
|
117
|
-
if (existsSync(lmgrepIgnorePath)) {
|
|
118
|
-
ig.add(readFileSync(lmgrepIgnorePath, "utf-8"));
|
|
119
|
-
}
|
|
120
|
-
return ig;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Walk the directory tree and yield file entries.
|
|
124
|
-
* Reads nested .gitignore files at each directory level.
|
|
125
|
-
*/
|
|
126
|
-
export function walkFiles(cwd, extraIgnore, extensions) {
|
|
127
|
-
const ig = buildIgnoreFilter(cwd, extraIgnore);
|
|
128
|
-
const exts = buildExtensionSet(extensions);
|
|
129
|
-
// Collect nested .gitignore rules
|
|
130
|
-
const allFiles = globSync("**/*", { cwd, nodir: true, dot: false });
|
|
131
|
-
// Build a set of directories that have .gitignore files
|
|
132
|
-
const nestedIgnores = new Map();
|
|
133
|
-
for (const f of allFiles) {
|
|
134
|
-
if (f.endsWith("/.gitignore") || f === ".gitignore")
|
|
135
|
-
continue;
|
|
136
|
-
const dir = dirname(f);
|
|
137
|
-
if (dir === "." || nestedIgnores.has(dir))
|
|
138
|
-
continue;
|
|
139
|
-
const nestedPath = join(cwd, dir, ".gitignore");
|
|
140
|
-
if (existsSync(nestedPath)) {
|
|
141
|
-
const nested = ignore();
|
|
142
|
-
nested.add(readFileSync(nestedPath, "utf-8"));
|
|
143
|
-
nestedIgnores.set(dir, nested);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return allFiles.filter((f) => {
|
|
147
|
-
if (!isCodeFile(f, exts))
|
|
148
|
-
return false;
|
|
149
|
-
if (ig.ignores(f))
|
|
150
|
-
return false;
|
|
151
|
-
// Check nested .gitignore rules
|
|
152
|
-
for (const [dir, nested] of nestedIgnores) {
|
|
153
|
-
if (f.startsWith(dir + "/")) {
|
|
154
|
-
const rel = f.slice(dir.length + 1);
|
|
155
|
-
if (nested.ignores(rel))
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return true;
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Hash a file's content for change detection.
|
|
164
|
-
*/
|
|
165
|
-
export function hashFile(cwd, filePath) {
|
|
166
|
-
try {
|
|
167
|
-
const content = readFileSync(join(cwd, filePath));
|
|
168
|
-
return createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
169
|
-
}
|
|
170
|
-
catch {
|
|
171
|
-
return undefined;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Compute changed files by comparing disk hashes against stored hashes.
|
|
176
|
-
*/
|
|
177
|
-
export function detectChanges(files, storedHashes, cwd, force = false) {
|
|
178
|
-
const changed = [];
|
|
179
|
-
const currentHashes = new Map();
|
|
180
|
-
for (const file of files) {
|
|
181
|
-
const hash = hashFile(cwd, file);
|
|
182
|
-
if (!hash)
|
|
183
|
-
continue;
|
|
184
|
-
currentHashes.set(file, hash);
|
|
185
|
-
if (force || storedHashes.get(file) !== hash) {
|
|
186
|
-
changed.push({ path: file, hash });
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return { changed, currentHashes };
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Filter files by modification time.
|
|
193
|
-
*/
|
|
194
|
-
export function filterByMtime(files, cwd, cutoffMs) {
|
|
195
|
-
return files.filter((f) => {
|
|
196
|
-
try {
|
|
197
|
-
return statSync(join(cwd, f)).mtimeMs >= cutoffMs;
|
|
198
|
-
}
|
|
199
|
-
catch {
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Watch a directory for code file changes. Calls the callback with debouncing.
|
|
206
|
-
* Collects changed file paths during the debounce window and passes them to the callback.
|
|
207
|
-
*/
|
|
208
|
-
export function watchFiles(cwd, extraIgnore, onChanges, debounceMs = 2000, extensions) {
|
|
209
|
-
const ig = buildIgnoreFilter(cwd, extraIgnore);
|
|
210
|
-
const exts = buildExtensionSet(extensions);
|
|
211
|
-
let timer;
|
|
212
|
-
let pending = new Set();
|
|
213
|
-
const watcher = watch(cwd, { recursive: true }, (_event, filename) => {
|
|
214
|
-
if (!filename)
|
|
215
|
-
return;
|
|
216
|
-
if (!isCodeFile(filename, exts))
|
|
217
|
-
return;
|
|
218
|
-
try {
|
|
219
|
-
if (ig.ignores(filename))
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
catch {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
pending.add(filename);
|
|
226
|
-
if (timer)
|
|
227
|
-
clearTimeout(timer);
|
|
228
|
-
timer = setTimeout(() => {
|
|
229
|
-
const files = [...pending];
|
|
230
|
-
pending = new Set();
|
|
231
|
-
onChanges(files);
|
|
232
|
-
}, debounceMs);
|
|
233
|
-
});
|
|
234
|
-
return {
|
|
235
|
-
close() {
|
|
236
|
-
if (timer)
|
|
237
|
-
clearTimeout(timer);
|
|
238
|
-
watcher.close();
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
//# sourceMappingURL=scanner.js.map
|
package/dist/lib/scanner.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../../src/lib/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,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AAC,CAAC;QACtB,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YACvB,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;YAC3B,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;YACpB,SAAS,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,EAAE,UAAU,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,OAAO;QACN,KAAK;YACJ,IAAI,KAAK;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAC/B,OAAO,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export type HealthReason = "ok" | "not_indexed" | "embedding_failed" | "search_empty";
|
|
2
|
-
export interface HealthState {
|
|
3
|
-
healthy: boolean;
|
|
4
|
-
reason: HealthReason;
|
|
5
|
-
}
|
|
6
|
-
export interface SearchArgs {
|
|
7
|
-
query: string;
|
|
8
|
-
limit?: number;
|
|
9
|
-
filePrefix?: string;
|
|
10
|
-
type?: string[];
|
|
11
|
-
language?: string[];
|
|
12
|
-
project?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface ToolResult {
|
|
15
|
-
text: string;
|
|
16
|
-
isError?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface ParamSpec {
|
|
19
|
-
description: string;
|
|
20
|
-
}
|
|
21
|
-
export interface SearchParamSpecs {
|
|
22
|
-
query: ParamSpec;
|
|
23
|
-
limit: ParamSpec & {
|
|
24
|
-
default: number;
|
|
25
|
-
};
|
|
26
|
-
filePrefix: ParamSpec;
|
|
27
|
-
type: ParamSpec;
|
|
28
|
-
language: ParamSpec;
|
|
29
|
-
project: ParamSpec;
|
|
30
|
-
}
|
|
31
|
-
export declare const searchParamSpecs: SearchParamSpecs;
|
|
32
|
-
export declare const listProjectsDescription: string;
|
|
33
|
-
export interface FacetArgs {
|
|
34
|
-
query: string;
|
|
35
|
-
}
|
|
36
|
-
export declare const facetDescription: string;
|
|
37
|
-
export declare const facetParamSpec: ParamSpec;
|
|
38
|
-
export interface LmgrepCore {
|
|
39
|
-
readonly cwd: string;
|
|
40
|
-
readonly searchParams: SearchParamSpecs;
|
|
41
|
-
readonly facetParam: ParamSpec;
|
|
42
|
-
readonly facetDescription: string;
|
|
43
|
-
readonly listProjectsDescription: string;
|
|
44
|
-
buildSearchDescription(): string;
|
|
45
|
-
currentHealth(): HealthState;
|
|
46
|
-
onHealthChange(cb: (state: HealthState) => void): () => void;
|
|
47
|
-
start(): void;
|
|
48
|
-
executeSearch(args: SearchArgs): Promise<ToolResult>;
|
|
49
|
-
executeFacet(args: FacetArgs): Promise<ToolResult>;
|
|
50
|
-
executeListProjects(): Promise<ToolResult>;
|
|
51
|
-
dispose(): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
export declare function createLmgrepCore(opts: {
|
|
54
|
-
cwd: string;
|
|
55
|
-
}): Promise<LmgrepCore>;
|