| 53 | * The current projects source code index. |
| 54 | */ |
| 55 | export declare class CodeIndex { |
| 56 | private readonly _folderPath; |
| 57 | private _config?; |
| 58 | private _keys?; |
| 59 | private _index?; |
| 60 | /** |
| 61 | * Creates a new 'CodeIndex' instance. |
| 62 | * @param folderPath Optional. The path to the folder containing the index. Defaults to '.codepilot'. |
| 63 | */ |
| 64 | constructor(folderPath?: string); |
| 65 | /** |
| 66 | * Gets the current code index configuration. |
| 67 | */ |
| 68 | get config(): CodeIndexConfig | undefined; |
| 69 | /** |
| 70 | * Gets the path to the folder containing the index. |
| 71 | */ |
| 72 | get folderPath(): string; |
| 73 | /** |
| 74 | * Gets the current OpenAI keys. |
| 75 | */ |
| 76 | get keys(): OpenAIKeys | undefined; |
| 77 | /** |
| 78 | * Adds sources and extensions to the index. |
| 79 | * @param config The configuration containing the sources and extensions to add. |
| 80 | */ |
| 81 | add(config: Partial<CodeIndexConfig>): Promise<void>; |
| 82 | /** |
| 83 | * Creates a new code index. |
| 84 | * @param keys OpenAI keys to use. |
| 85 | * @param config Source code index configuration. |
| 86 | */ |
| 87 | create(keys: OpenAIKeys, config: CodeIndexConfig): Promise<void>; |
| 88 | /** |
| 89 | * Deletes the current code index. |
| 90 | */ |
| 91 | delete(): Promise<void>; |
| 92 | /** |
| 93 | * Returns whether a `vectra.keys` file exists for the index. |
| 94 | */ |
| 95 | hasKeys(): Promise<boolean>; |
| 96 | /** |
| 97 | * Returns true if the index has been created. |
| 98 | */ |
| 99 | isCreated(): Promise<boolean>; |
| 100 | /** |
| 101 | * Loads the current code index. |
| 102 | */ |
| 103 | load(): Promise<LocalDocumentIndex>; |
| 104 | /** |
| 105 | * Queries the code index. |
| 106 | * @param query Text to query the index with. |
| 107 | * @param options Optional. Options to use when querying the index. |
| 108 | * @returns Found documents. |
| 109 | */ |
| 110 | query(query: string, options?: DocumentQueryOptions): Promise<LocalDocumentResult[]>; |
| 111 | /** |
| 112 | * Rebuilds the code index. |
nothing calls this directly
no outgoing calls
no test coverage detected