indexer-cli 0.3.5 → 0.3.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.
@@ -0,0 +1,70 @@
1
+ import type { ContextPackIntent, ContextPackProfile, ContextPackResult, GitOperations, MetadataStore, PackMeta, ProjectId, SnapshotId } from "../core/types.js";
2
+ import type { SearchEngine } from "./searcher.js";
3
+ type ContextPackScope = {
4
+ kind: "all";
5
+ } | {
6
+ kind: "changed";
7
+ } | {
8
+ kind: "relevant-to";
9
+ value: string;
10
+ } | {
11
+ kind: "path-prefix";
12
+ value: string;
13
+ };
14
+ type ContextPackSearch = Pick<SearchEngine, "search">;
15
+ export type ContextPackBuildOptions = {
16
+ budget?: number;
17
+ profile?: ContextPackProfile;
18
+ scope?: string;
19
+ maxModules?: number;
20
+ maxFiles?: number;
21
+ maxSnippets?: number;
22
+ minScore?: number;
23
+ explainSymbols?: boolean;
24
+ excludePathPatterns?: string[];
25
+ includeFixtures?: boolean;
26
+ };
27
+ type ResolvedContextPackOptions = {
28
+ budget: number;
29
+ profile: ContextPackProfile;
30
+ scope: ContextPackScope;
31
+ maxModules: number;
32
+ maxFiles: number;
33
+ maxSnippets: number;
34
+ minScore?: number;
35
+ explainSymbols: boolean;
36
+ excludePathPatterns: string[];
37
+ includeFixtures: boolean;
38
+ evidenceThreshold: number;
39
+ searchTopK: number;
40
+ };
41
+ type ModuleMetric = {
42
+ module: string;
43
+ maxSemanticScore: number;
44
+ hitCount: number;
45
+ symbolOverlap: number;
46
+ dependencyProximity: number;
47
+ pathPrior: number;
48
+ changedBoost: number;
49
+ fileCount: number;
50
+ reasons: string[];
51
+ };
52
+ export type ScoredModule = {
53
+ module: string;
54
+ score: number;
55
+ reasons: string[];
56
+ metrics: Omit<ModuleMetric, "module" | "reasons">;
57
+ };
58
+ export declare function normalizeContextPackIntent(task: string): ContextPackIntent;
59
+ export declare function buildContextPackProfile(options?: ContextPackBuildOptions): ResolvedContextPackOptions;
60
+ export declare function inferContextPackConfidenceBand(confidence: number): PackMeta["confidenceBand"];
61
+ export declare function scoreContextPackModules(metrics: ModuleMetric[]): ScoredModule[];
62
+ export declare class ContextPackBuilder {
63
+ private readonly metadata;
64
+ private readonly search;
65
+ private readonly git;
66
+ private readonly repoRoot;
67
+ constructor(metadata: MetadataStore, search: ContextPackSearch, git: GitOperations, repoRoot: string);
68
+ build(projectId: ProjectId, snapshotId: SnapshotId, task: string, options?: ContextPackBuildOptions): Promise<ContextPackResult>;
69
+ }
70
+ export {};