forked from continuedev/continue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
34 lines (28 loc) · 881 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type {
ContextItem,
ContextProviderDescription,
ContextProviderExtras,
ContextSubmenuItem,
IContextProvider,
LoadSubmenuItemsArgs,
} from "../index.js";
export abstract class BaseContextProvider implements IContextProvider {
options: { [key: string]: any };
constructor(options: { [key: string]: any }) {
this.options = options;
}
static description: ContextProviderDescription;
get description(): ContextProviderDescription {
return (this.constructor as any).description;
}
// Maybe just include the chat message in here. Should never have to go back to the context provider once you have the information.
abstract getContextItems(
query: string,
extras: ContextProviderExtras,
): Promise<ContextItem[]>;
async loadSubmenuItems(
args: LoadSubmenuItemsArgs,
): Promise<ContextSubmenuItem[]> {
return [];
}
}