kontext-engine 0.1.4 → 0.1.6
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 +8 -1
- package/dist/cli/index.js +652 -111
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.js +553 -148
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,11 @@ interface ChunkWithFile {
|
|
|
72
72
|
text: string;
|
|
73
73
|
exports: boolean;
|
|
74
74
|
}
|
|
75
|
+
interface IndexEmbedderMetadata {
|
|
76
|
+
provider: string;
|
|
77
|
+
model: string;
|
|
78
|
+
dimensions: number;
|
|
79
|
+
}
|
|
75
80
|
interface ChunkSearchFilters {
|
|
76
81
|
name?: string;
|
|
77
82
|
nameMode?: "exact" | "prefix" | "contains";
|
|
@@ -93,6 +98,7 @@ interface KontextDatabase {
|
|
|
93
98
|
insertChunks(fileId: number, chunks: ChunkInput[]): number[];
|
|
94
99
|
getChunksByFile(fileId: number): ChunkRecord[];
|
|
95
100
|
getChunksByIds(ids: number[]): ChunkWithFile[];
|
|
101
|
+
getChunksMissingVectors(): ChunkWithFile[];
|
|
96
102
|
deleteChunksByFile(fileId: number): void;
|
|
97
103
|
insertDependency(sourceChunkId: number, targetChunkId: number, type: string): void;
|
|
98
104
|
getDependencies(chunkId: number): {
|
|
@@ -118,6 +124,9 @@ interface KontextDatabase {
|
|
|
118
124
|
close(): void;
|
|
119
125
|
getSchemaVersion(): number;
|
|
120
126
|
pragma(key: string): string;
|
|
127
|
+
getVectorDimensions(): number | null;
|
|
128
|
+
getIndexEmbedder(): IndexEmbedderMetadata | null;
|
|
129
|
+
setIndexEmbedder(metadata: IndexEmbedderMetadata): void;
|
|
121
130
|
}
|
|
122
131
|
/** Create or open a SQLite database at the given path. Initializes schema and loads sqlite-vec. */
|
|
123
132
|
declare function createDatabase(dbPath: string, dimensions?: number): KontextDatabase;
|
|
@@ -135,9 +144,9 @@ declare function prepareChunkText(filePath: string, parent: string | null, text:
|
|
|
135
144
|
/** Create a local embedder using Xenova/all-MiniLM-L6-v2 (384 dims, ONNX Runtime). */
|
|
136
145
|
declare function createLocalEmbedder(): Promise<Embedder>;
|
|
137
146
|
/** Create an embedder using Voyage AI's code embedding API. */
|
|
138
|
-
declare function createVoyageEmbedder(apiKey: string): Embedder;
|
|
147
|
+
declare function createVoyageEmbedder(apiKey: string, dimensions?: number): Embedder;
|
|
139
148
|
/** Create an embedder using OpenAI's text-embedding-3-small API. */
|
|
140
|
-
declare function createOpenAIEmbedder(apiKey: string): Embedder;
|
|
149
|
+
declare function createOpenAIEmbedder(apiKey: string, dimensions?: number): Embedder;
|
|
141
150
|
|
|
142
151
|
/** Project-level configuration stored in .ctx/config.json. */
|
|
143
152
|
interface KontextConfig {
|
|
@@ -406,6 +415,7 @@ interface AskOutput {
|
|
|
406
415
|
declare function runAsk(projectPath: string, query: string, options: AskOptions): Promise<AskOutput>;
|
|
407
416
|
|
|
408
417
|
interface ProjectConfig {
|
|
418
|
+
provider: string;
|
|
409
419
|
model: string;
|
|
410
420
|
dimensions: number;
|
|
411
421
|
}
|
|
@@ -419,6 +429,8 @@ interface StatusOutput {
|
|
|
419
429
|
lastIndexed: string | null;
|
|
420
430
|
languages: Map<string, number>;
|
|
421
431
|
config: ProjectConfig | null;
|
|
432
|
+
indexEmbedder: ProjectConfig | null;
|
|
433
|
+
embedderWarning: string | null;
|
|
422
434
|
text: string;
|
|
423
435
|
}
|
|
424
436
|
/** Gather index statistics: file/chunk/vector counts, languages, DB size, config. */
|