UNPKG

socraticode

Version:

SocratiCode — MCP server for local codebase indexing, semantic search, and code dependency graphs. All private, all local via Docker.

58 lines • 3.34 kB
import type { InfraProgressCallback } from "./docker.js"; import { type EmbeddingProvider } from "./embedding-config.js"; import type { EmbeddingReadinessResult } from "./embedding-types.js"; export declare const INDEX_PROFILE_SCHEMA_VERSION = 1; /** * Bumped when a build changes the chunks it produces from unchanged input, so * that an index built by an earlier build is reported as differing from what * this build would produce. * * 2: the per-chunk character cap splits instead of truncating. Indexing skips * files whose content hash is unchanged, so without this an index built by an * earlier version keeps its truncated chunks indefinitely — only edited files * would be re-chunked, leaving the collection quietly mixed. */ export declare const CURRENT_INDEX_FORMAT_VERSION = 2; export type IndexProfileKind = "code" | "context"; export type IndexProfileSource = "fresh" | "legacy-adopted"; export interface EffectiveEmbeddingIdentity { provider: EmbeddingProvider; model: string; dimensions: number; contextLength: number; litellmSendDimensions: boolean; } export interface EffectiveIndexProfile { schemaVersion: typeof INDEX_PROFILE_SCHEMA_VERSION; indexFormatVersion: number; kind: IndexProfileKind; source: IndexProfileSource; queryPrefix: string; documentPrefix: string; documentIncludesPath: boolean; maxChunkChars: number; embedding: EffectiveEmbeddingIdentity; /** Custom extension to canonical-extension mapping. Code profiles only. */ extensionLanguageMap?: Record<string, string>; /** Maximum source-file bytes. Code profiles only. */ maxFileBytes?: number; /** Values adopted from current runtime because legacy metadata did not store them. */ legacyUnverifiedFields: string[]; } export declare function requestedIndexProfile(kind: IndexProfileKind): EffectiveIndexProfile; export declare function legacyIndexProfile(kind: IndexProfileKind, verifiedEmbeddingDimensions?: number): EffectiveIndexProfile; export declare function resolveEffectiveIndexProfile(kind: IndexProfileKind, stored: EffectiveIndexProfile | null, collectionHasData: boolean, legacyEmbeddingDimensions?: number): EffectiveIndexProfile; export declare function profileExtensionLanguageMap(profile: EffectiveIndexProfile): Map<string, string>; export declare function withEffectiveEmbedding<T>(profile: EffectiveIndexProfile, operation: () => T): T; /** Ensure the provider selected by a collection profile is ready for indexing. */ export declare function ensureEffectiveEmbeddingReady(profile: EffectiveIndexProfile, onProgress?: InfraProgressCallback): Promise<EmbeddingReadinessResult>; /** Reset effective-provider readiness state for tests. */ export declare function resetEffectiveEmbeddingReadiness(): void; export declare function documentTextProfile(profile: EffectiveIndexProfile): { documentPrefix: string; documentIncludesPath: boolean; }; export declare function queryProfileKey(profile: EffectiveIndexProfile, collectionName: string): string; export declare function indexProfileDifferences(effective: EffectiveIndexProfile, requested: EffectiveIndexProfile): string[]; export declare function parseEffectiveIndexProfile(value: unknown, expectedKind?: IndexProfileKind): EffectiveIndexProfile; //# sourceMappingURL=index-profile.d.ts.map