fix: update path handling and type imports in indexer and query tools

This commit is contained in:
Giancarlo Erra
2026-04-09 16:58:40 +01:00
parent 76e3ff5f59
commit 096f59da13
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -170,7 +170,7 @@ function migrateAbsolutePathKeys(hashes: Map<string, string>, resolvedProjectPat
// Try to strip the stored project path prefix, or detect the common prefix
const prefix = resolvedProjectPath
? resolvedProjectPath + "/"
? `${resolvedProjectPath}/`
: detectCommonPrefix(hashes);
if (!prefix) {
+2 -1
View File
@@ -14,6 +14,7 @@ import { getLockHolderPid, } from "../services/lock.js";
import { ensureOllamaReady } from "../services/ollama.js";
import { getCollectionInfo, getProjectMetadata, searchChunks, searchMultipleCollections } from "../services/qdrant.js";
import { ensureWatcherStarted, isWatchedByAnyProcess, isWatching } from "../services/watcher.js";
import type { SearchResult } from "../types.js";
/** Format an IndexingProgress into display lines (elapsed, progress, batches, graph). */
function formatProgressLines(progress: IndexingProgress): {
@@ -73,7 +74,7 @@ export async function handleQueryTool(
const languageFilter = args.languageFilter as string | undefined;
const includeLinked = args.includeLinked as boolean | undefined;
let allResults;
let allResults: SearchResult[];
if (includeLinked) {
const collections = resolveLinkedCollections(resolvedPath);
allResults = await searchMultipleCollections(collections, query, limit, fileFilter, languageFilter);
+1 -1
View File
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (C) 2026 Giancarlo Erra - Altaire Limited
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { collectionName, contextCollectionName, detectGitBranch, graphCollectionName, loadLinkedProjects, projectIdFromPath, resolveLinkedCollections, sanitizeBranchName } from "../../src/config.js";
describe("config", () => {
+1 -1
View File
@@ -8,8 +8,8 @@
*/
import { describe, expect, it } from "vitest";
import type { SearchResult } from "../../src/types.js";
import { mergeMultiCollectionResults } from "../../src/services/qdrant.js";
import type { SearchResult } from "../../src/types.js";
// ── Helpers ─────────────────────────────────────────────────────────────