Elffuss BraidHub

kikocis/continue public

main · 947 BRawPermalink
1import type {
2 ContextItem,
3 ContextProviderDescription,
4 ContextProviderExtras,
5 ContextSubmenuItem,
6 IContextProvider,
7 LoadSubmenuItemsArgs,
8} from "../index.js";
9
10export abstract class BaseContextProvider implements IContextProvider {
11 options: { [key: string]: any };
12
13 constructor(options: { [key: string]: any }) {
14 this.options = options;
15 }
16
17 static description: ContextProviderDescription;
18
19 get description(): ContextProviderDescription {
20 return (this.constructor as any).description;
21 }
22
23 // Maybe just include the chat message in here. Should never have to go back to the context provider once you have the information.
24 abstract getContextItems(
25 query: string,
26 extras: ContextProviderExtras,
27 ): Promise<ContextItem[]>;
28
29 async loadSubmenuItems(
30 args: LoadSubmenuItemsArgs,
31 ): Promise<ContextSubmenuItem[]> {
32 return [];
33 }
34
35 get deprecationMessage(): string | null {
36 return null;
37 }
38}