@ninjaxtools/slopdex 0.10.0 → 0.11.0
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/.agents/skills/slopdex/SKILL.md +13 -13
- package/README.md +18 -16
- package/dist/cli.js +409 -282
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +40 -40
- package/dist/index.js +329 -234
- package/dist/index.js.map +1 -1
- package/docs/implementation.md +20 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare class CodeIndex {
|
|
|
3
3
|
readonly rootDir: string;
|
|
4
4
|
readonly indexPath: string;
|
|
5
5
|
readonly provider: EmbeddingProvider;
|
|
6
|
-
readonly
|
|
6
|
+
readonly descriptionProvider: DescriptionProvider;
|
|
7
7
|
constructor(options: CodeIndexOptions);
|
|
8
8
|
close(): void;
|
|
9
9
|
status(): IndexStatus;
|
|
@@ -12,14 +12,14 @@ declare class CodeIndex {
|
|
|
12
12
|
updateFiles(options: UpdateFilesOptions): Promise<UpdateStats>;
|
|
13
13
|
updateFromWorkingTree(options?: UpdateFromWorkingTreeOptions): Promise<UpdateStats>;
|
|
14
14
|
updateFromGit(options?: UpdateFromGitOptions): Promise<UpdateStats>;
|
|
15
|
-
|
|
15
|
+
useDescriptions(options?: {
|
|
16
16
|
signal?: AbortSignal;
|
|
17
|
-
}): Promise<
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
}): Promise<DescriptionStats>;
|
|
18
|
+
disableDescriptions(): DescriptionStats;
|
|
19
|
+
searchDescription(options: SimilaritySearchOptions): Promise<SimilarityResult[]>;
|
|
20
20
|
similaritySearch(options: SimilaritySearchOptions): Promise<SimilarityResult[]>;
|
|
21
21
|
similarToFunction(functionId: number, options: {
|
|
22
|
-
|
|
22
|
+
includeDescriptions?: boolean;
|
|
23
23
|
limit: number;
|
|
24
24
|
minSimilarity: number;
|
|
25
25
|
maxSimilarity?: number;
|
|
@@ -27,9 +27,9 @@ declare class CodeIndex {
|
|
|
27
27
|
minLines?: number;
|
|
28
28
|
nameRegex?: string;
|
|
29
29
|
}): SimilarityResult[];
|
|
30
|
-
vectorForFunction(functionId: number, kind?: "code" | "
|
|
30
|
+
vectorForFunction(functionId: number, kind?: "code" | "description"): number[];
|
|
31
31
|
searchByVector(vector: readonly number[], options: {
|
|
32
|
-
|
|
32
|
+
descriptionVector?: readonly number[];
|
|
33
33
|
limit: number;
|
|
34
34
|
minSimilarity: number;
|
|
35
35
|
maxSimilarity?: number;
|
|
@@ -84,8 +84,8 @@ interface IndexedFunction extends ParsedCallable {
|
|
|
84
84
|
lastSeenCommit: string | null;
|
|
85
85
|
sourceMode: SourceMode;
|
|
86
86
|
embeddingId: number;
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
description: string | null;
|
|
88
|
+
descriptionEmbeddingId: number | null;
|
|
89
89
|
}
|
|
90
90
|
interface EmbeddingProfile {
|
|
91
91
|
provider: "openai" | "jina" | string;
|
|
@@ -102,31 +102,31 @@ interface EmbeddingProvider {
|
|
|
102
102
|
signal?: AbortSignal;
|
|
103
103
|
}): Promise<number[]>;
|
|
104
104
|
}
|
|
105
|
-
interface
|
|
105
|
+
interface DescriptionProfile {
|
|
106
106
|
provider: string;
|
|
107
107
|
model: string;
|
|
108
108
|
strategyVersion: string;
|
|
109
109
|
}
|
|
110
|
-
interface
|
|
110
|
+
interface DescriptionInput {
|
|
111
111
|
repository: string;
|
|
112
112
|
callable: ParsedCallable;
|
|
113
113
|
fileSource: string;
|
|
114
114
|
}
|
|
115
|
-
interface
|
|
116
|
-
readonly profile:
|
|
117
|
-
|
|
115
|
+
interface DescriptionProvider {
|
|
116
|
+
readonly profile: DescriptionProfile;
|
|
117
|
+
describe(input: DescriptionInput, options?: {
|
|
118
118
|
signal?: AbortSignal;
|
|
119
119
|
}): Promise<string>;
|
|
120
120
|
}
|
|
121
|
-
interface
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
interface DescriptionStats {
|
|
122
|
+
descriptionsCreated: number;
|
|
123
|
+
descriptionsEnabled: boolean;
|
|
124
124
|
}
|
|
125
125
|
interface CodeIndexOptions {
|
|
126
126
|
rootDir: string;
|
|
127
127
|
indexPath?: string;
|
|
128
128
|
provider: EmbeddingProvider;
|
|
129
|
-
|
|
129
|
+
descriptionProvider?: DescriptionProvider;
|
|
130
130
|
onWarning?: (message: string) => void;
|
|
131
131
|
include?: readonly string[];
|
|
132
132
|
exclude?: readonly string[];
|
|
@@ -173,13 +173,13 @@ interface SimilaritySearchOptions {
|
|
|
173
173
|
interface SimilarityScores {
|
|
174
174
|
similarity: number;
|
|
175
175
|
codeSimilarity?: number;
|
|
176
|
-
|
|
176
|
+
descriptionSimilarity?: number;
|
|
177
177
|
}
|
|
178
178
|
interface AnalysisSimilarity {
|
|
179
|
-
similarityMode: "code" | "code-
|
|
179
|
+
similarityMode: "code" | "code-description-average";
|
|
180
180
|
similarityWeights: {
|
|
181
181
|
code: number;
|
|
182
|
-
|
|
182
|
+
description: number;
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
interface SimilarityResult extends SimilarityScores {
|
|
@@ -221,8 +221,8 @@ interface CrossSearchResult {
|
|
|
221
221
|
source: IndexedFunction;
|
|
222
222
|
matches: SimilarityResult[];
|
|
223
223
|
scoring?: AnalysisSimilarity & {
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
sourceDescriptionProfile: DescriptionProfile | null;
|
|
225
|
+
targetDescriptionProfile: DescriptionProfile | null;
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
type CohesionLocationCategory = "same-file" | "same-folder" | "different-folder";
|
|
@@ -277,7 +277,7 @@ interface CohesionGroup<FunctionValue = IndexedFunction> {
|
|
|
277
277
|
maximumCohesionGap: number;
|
|
278
278
|
members: FunctionValue[];
|
|
279
279
|
}
|
|
280
|
-
interface
|
|
280
|
+
interface CohesionMetrics {
|
|
281
281
|
scope: "repository" | "selected-sources";
|
|
282
282
|
functionsAnalyzed: number;
|
|
283
283
|
candidateFunctions: number;
|
|
@@ -303,12 +303,12 @@ interface CohesionAnalysisOptions {
|
|
|
303
303
|
}) => void;
|
|
304
304
|
}
|
|
305
305
|
interface CohesionReport<FunctionValue = IndexedFunction> {
|
|
306
|
-
schemaVersion:
|
|
306
|
+
schemaVersion: 2;
|
|
307
307
|
repository: {
|
|
308
308
|
generation: number;
|
|
309
309
|
gitCheckpoint: string | null;
|
|
310
310
|
embeddingProfile: Required<EmbeddingProfile>;
|
|
311
|
-
|
|
311
|
+
descriptionProfile: DescriptionProfile | null;
|
|
312
312
|
};
|
|
313
313
|
parameters: AnalysisSimilarity & {
|
|
314
314
|
neighbors: number;
|
|
@@ -319,7 +319,7 @@ interface CohesionReport<FunctionValue = IndexedFunction> {
|
|
|
319
319
|
nameRegex?: string;
|
|
320
320
|
sourceFilter: CrossSearchSourceFilter;
|
|
321
321
|
};
|
|
322
|
-
|
|
322
|
+
metrics: CohesionMetrics;
|
|
323
323
|
pairs: CohesionPair<FunctionValue>[];
|
|
324
324
|
files: CohesionFileReport<FunctionValue>[];
|
|
325
325
|
groups: CohesionGroup<FunctionValue>[];
|
|
@@ -333,9 +333,9 @@ interface IndexStatus {
|
|
|
333
333
|
generation: number;
|
|
334
334
|
gitCheckpoint: string | null;
|
|
335
335
|
embeddingProfile: Required<EmbeddingProfile>;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
descriptionsEnabled: boolean;
|
|
337
|
+
descriptionCount: number;
|
|
338
|
+
descriptionProfile: DescriptionProfile | null;
|
|
339
339
|
indexingErrorCount: number;
|
|
340
340
|
failedFileCount: number;
|
|
341
341
|
}
|
|
@@ -370,20 +370,20 @@ declare class OpenAIEmbeddingProvider implements EmbeddingProvider {
|
|
|
370
370
|
}): Promise<number[]>;
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
interface
|
|
373
|
+
interface OpenAIDescriptionProviderOptions {
|
|
374
374
|
apiKey?: string;
|
|
375
375
|
model?: string;
|
|
376
376
|
baseUrl?: string;
|
|
377
377
|
}
|
|
378
|
-
declare class
|
|
378
|
+
declare class OpenAIDescriptionProvider implements DescriptionProvider {
|
|
379
379
|
#private;
|
|
380
380
|
readonly profile: {
|
|
381
381
|
provider: string;
|
|
382
382
|
model: string;
|
|
383
383
|
strategyVersion: string;
|
|
384
384
|
};
|
|
385
|
-
constructor(options?:
|
|
386
|
-
|
|
385
|
+
constructor(options?: OpenAIDescriptionProviderOptions);
|
|
386
|
+
describe(input: DescriptionInput, options?: {
|
|
387
387
|
signal?: AbortSignal;
|
|
388
388
|
}): Promise<string>;
|
|
389
389
|
}
|
|
@@ -429,12 +429,12 @@ declare function updateFiles(index: CodeIndex, options: UpdateFilesOptions): Pro
|
|
|
429
429
|
declare function updateFromGit(index: CodeIndex, options?: UpdateFromGitOptions): Promise<UpdateStats>;
|
|
430
430
|
declare function updateFromWorkingTree(index: CodeIndex, options?: UpdateFromWorkingTreeOptions): Promise<UpdateStats>;
|
|
431
431
|
declare function similaritySearch(index: CodeIndex, options: SimilaritySearchOptions): Promise<SimilarityResult[]>;
|
|
432
|
-
declare function
|
|
432
|
+
declare function useDescriptions(index: CodeIndex, options?: {
|
|
433
433
|
signal?: AbortSignal;
|
|
434
|
-
}): Promise<
|
|
435
|
-
declare function
|
|
436
|
-
declare function
|
|
434
|
+
}): Promise<DescriptionStats>;
|
|
435
|
+
declare function disableDescriptions(index: CodeIndex): DescriptionStats;
|
|
436
|
+
declare function searchDescription(index: CodeIndex, options: SimilaritySearchOptions): Promise<SimilarityResult[]>;
|
|
437
437
|
declare function crossSearchFunctions(options: CrossSearchOptions): AsyncGenerator<CrossSearchResult, any, any>;
|
|
438
438
|
declare function analyzeCodeCohesion(options: CohesionAnalysisOptions): Promise<CohesionReport<IndexedFunction>>;
|
|
439
439
|
|
|
440
|
-
export { type AnalysisSimilarity, type CallableKind, CodeIndex, CodeIndexError, type CodeIndexOptions, type CohesionAnalysisOptions, type CohesionFileReport, type CohesionFunctionReference, type CohesionGroup, type CohesionJsonReport, type CohesionLocation, type CohesionLocationCategory, type
|
|
440
|
+
export { type AnalysisSimilarity, type CallableKind, CodeIndex, CodeIndexError, type CodeIndexOptions, type CohesionAnalysisOptions, type CohesionFileReport, type CohesionFunctionReference, type CohesionGroup, type CohesionJsonReport, type CohesionLocation, type CohesionLocationCategory, type CohesionMetrics, type CohesionPair, type CohesionReport, type CrossSearchOptions, type CrossSearchResult, type CrossSearchSourceFilter, type DescriptionInput, type DescriptionProfile, type DescriptionProvider, type DescriptionStats, type EmbeddingProfile, type EmbeddingProvider, GitDivergenceError, GitUnavailableError, IncompatibleIndexError, type IndexStatus, type IndexedFunction, type IndexingError, type IndexingIssue, JinaEmbeddingProvider, type JinaEmbeddingProviderOptions, OpenAIDescriptionProvider, type OpenAIDescriptionProviderOptions, OpenAIEmbeddingProvider, type OpenAIEmbeddingProviderOptions, type ParsedCallable, type SimilarityResult, type SimilarityScores, type SimilaritySearchOptions, type SourceMode, type SupportedLanguage, type UpdateFilesOptions, type UpdateFromGitOptions, type UpdateFromWorkingTreeOptions, type UpdateStats, analyzeCodeCohesion, analyzeCohesion, cohesionLocation, crossSearch, crossSearchFunctions, disableDescriptions, openCodeIndex, readIndexErrors, searchDescription, similaritySearch, updateFiles, updateFromGit, updateFromWorkingTree, useDescriptions };
|