mirror of
https://github.com/giancarloerra/socraticode.git
synced 2026-07-03 14:05:21 +02:00
fix: update path handling and type imports in indexer and query tools
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,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", () => {
|
||||
|
||||
@@ -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 ─────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user