forked from continuedev/continue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
1083 lines (955 loc) · 25.5 KB
/
index.d.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { GetGhTokenArgs } from "./protocol/ide";
declare global {
interface Window {
ide?: "vscode";
windowId: string;
serverUrl: string;
vscMachineId: string;
vscMediaUrl: string;
fullColorTheme?: {
rules?: {
token?: string;
foreground?: string;
}[];
};
colorThemeName?: string;
workspacePaths?: string[];
postIntellijMessage?: (
messageType: string,
data: any,
messageIde: string,
) => void;
}
}
export interface ChunkWithoutID {
content: string;
startLine: number;
endLine: number;
signature?: string;
otherMetadata?: { [key: string]: any };
}
export interface Chunk extends ChunkWithoutID {
digest: string;
filepath: string;
index: number; // Index of the chunk in the document at filepath
}
export interface IndexingProgressUpdate {
progress: number;
desc: string;
shouldClearIndexes?: boolean;
status: "loading" | "indexing" | "done" | "failed" | "paused" | "disabled";
debugInfo?: string;
}
export type PromptTemplate =
| string
| ((
history: ChatMessage[],
otherData: Record<string, string>,
) => string | ChatMessage[]);
export interface ILLM extends LLMOptions {
get providerName(): ModelProvider;
uniqueId: string;
model: string;
title?: string;
systemMessage?: string;
contextLength: number;
maxStopWords?: number;
completionOptions: CompletionOptions;
requestOptions?: RequestOptions;
promptTemplates?: Record<string, PromptTemplate>;
templateMessages?: (messages: ChatMessage[]) => string;
writeLog?: (str: string) => Promise<void>;
llmRequestHook?: (model: string, prompt: string) => any;
apiKey?: string;
apiBase?: string;
cacheBehavior?: CacheBehavior;
engine?: string;
apiVersion?: string;
apiType?: string;
region?: string;
projectId?: string;
complete(prompt: string, options?: LLMFullCompletionOptions): Promise<string>;
streamComplete(
prompt: string,
options?: LLMFullCompletionOptions,
): AsyncGenerator<string, PromptLog>;
streamFim(
prefix: string,
suffix: string,
options?: LLMFullCompletionOptions,
): AsyncGenerator<string, PromptLog>;
streamChat(
messages: ChatMessage[],
options?: LLMFullCompletionOptions,
): AsyncGenerator<ChatMessage, PromptLog>;
chat(
messages: ChatMessage[],
options?: LLMFullCompletionOptions,
): Promise<ChatMessage>;
countTokens(text: string): number;
supportsImages(): boolean;
supportsCompletions(): boolean;
supportsPrefill(): boolean;
supportsFim(): boolean;
listModels(): Promise<string[]>;
renderPromptTemplate(
template: PromptTemplate,
history: ChatMessage[],
otherData: Record<string, string>,
canPutWordsInModelsMouth?: boolean,
): string | ChatMessage[];
}
export type ContextProviderType = "normal" | "query" | "submenu";
export interface ContextProviderDescription {
title: ContextProviderName;
displayTitle: string;
description: string;
renderInlineAs?: string;
type: ContextProviderType;
dependsOnIndexing?: boolean;
}
export type FetchFunction = (url: string | URL, init?: any) => Promise<any>;
export interface ContextProviderExtras {
config: ContinueConfig;
fullInput: string;
embeddingsProvider: EmbeddingsProvider;
reranker: Reranker | undefined;
llm: ILLM;
ide: IDE;
selectedCode: RangeInFile[];
fetch: FetchFunction;
}
export interface LoadSubmenuItemsArgs {
config: ContinueConfig;
ide: IDE;
fetch: FetchFunction;
}
export interface CustomContextProvider {
title: string;
displayTitle?: string;
description?: string;
renderInlineAs?: string;
type?: ContextProviderType;
getContextItems(
query: string,
extras: ContextProviderExtras,
): Promise<ContextItem[]>;
loadSubmenuItems?: (
args: LoadSubmenuItemsArgs,
) => Promise<ContextSubmenuItem[]>;
}
export interface ContextSubmenuItem {
id: string;
title: string;
description: string;
icon?: string;
metadata?: any;
}
export interface SiteIndexingConfig {
title: string;
startUrl: string;
rootUrl?: string;
maxDepth?: number;
faviconUrl?: string;
}
export interface SiteIndexingConfig {
startUrl: string;
rootUrl?: string;
title: string;
maxDepth?: number;
}
export interface IContextProvider {
get description(): ContextProviderDescription;
getContextItems(
query: string,
extras: ContextProviderExtras,
): Promise<ContextItem[]>;
loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise<ContextSubmenuItem[]>;
}
export interface PersistedSessionInfo {
history: ChatHistory;
title: string;
workspaceDirectory: string;
sessionId: string;
}
export interface SessionInfo {
sessionId: string;
title: string;
dateCreated: string;
workspaceDirectory: string;
}
export interface RangeInFile {
filepath: string;
range: Range;
}
export interface Location {
filepath: string;
position: Position;
}
export interface FileWithContents {
filepath: string;
contents: string;
}
export interface Range {
start: Position;
end: Position;
}
export interface Position {
line: number;
character: number;
}
export interface FileEdit {
filepath: string;
range: Range;
replacement: string;
}
export interface ContinueError {
title: string;
message: string;
}
export interface CompletionOptions extends BaseCompletionOptions {
model: string;
}
export type ChatMessageRole = "user" | "assistant" | "system";
export interface MessagePart {
type: "text" | "imageUrl";
text?: string;
imageUrl?: { url: string };
}
export type MessageContent = string | MessagePart[];
export interface ChatMessage {
role: ChatMessageRole;
content: MessageContent;
}
export interface ContextItemId {
providerTitle: string;
itemId: string;
}
export type ContextItemUriTypes = "file" | "url";
export interface ContextItemUri {
type: ContextItemUriTypes;
value: string;
}
export interface ContextItem {
content: string;
name: string;
description: string;
editing?: boolean;
editable?: boolean;
icon?: string;
uri?: ContextItemUri;
}
export interface ContextItemWithId extends ContextItem {
id: ContextItemId;
}
export interface InputModifiers {
useCodebase: boolean;
noContext: boolean;
}
export interface PromptLog {
modelTitle: string;
completionOptions: CompletionOptions;
prompt: string;
completion: string;
}
export interface ChatHistoryItem {
message: ChatMessage;
editorState?: any;
modifiers?: InputModifiers;
contextItems: ContextItemWithId[];
promptLogs?: PromptLog[];
}
export type ChatHistory = ChatHistoryItem[];
// LLM
export interface LLMFullCompletionOptions extends BaseCompletionOptions {
log?: boolean;
model?: string;
}
export type ToastType = "info" | "error" | "warning";
export interface LLMOptions {
model: string;
title?: string;
uniqueId?: string;
systemMessage?: string;
contextLength?: number;
maxStopWords?: number;
completionOptions?: CompletionOptions;
requestOptions?: RequestOptions;
template?: TemplateType;
promptTemplates?: Record<string, PromptTemplate>;
templateMessages?: (messages: ChatMessage[]) => string;
writeLog?: (str: string) => Promise<void>;
llmRequestHook?: (model: string, prompt: string) => any;
apiKey?: string;
aiGatewaySlug?: string;
apiBase?: string;
cacheBehavior?: CacheBehavior;
useLegacyCompletionsEndpoint?: boolean;
// Cloudflare options
accountId?: string;
// Azure options
engine?: string;
apiVersion?: string;
apiType?: string;
// AWS options
profile?: string;
modelArn?: string;
// AWS and GCP Options
region?: string;
// GCP Options
projectId?: string;
capabilities?: ModelCapability;
// IBM watsonx options
watsonxUrl?: string;
watsonxCreds?: string;
watsonxProjectId?: string;
watsonxStopToken?: string;
watsonxApiVersion?: string;
watsonxFullUrl?: string;
}
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<
T,
Exclude<keyof T, Keys>
> &
{
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
}[Keys];
export interface CustomLLMWithOptionals {
options: LLMOptions;
streamCompletion?: (
prompt: string,
options: CompletionOptions,
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
) => AsyncGenerator<string>;
streamChat?: (
messages: ChatMessage[],
options: CompletionOptions,
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
) => AsyncGenerator<string>;
listModels?: (
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
) => Promise<string[]>;
}
/**
* The LLM interface requires you to specify either `streamCompletion` or `streamChat` (or both).
*/
export type CustomLLM = RequireAtLeastOne<
CustomLLMWithOptionals,
"streamCompletion" | "streamChat"
>;
// IDE
export type DiffLineType = "new" | "old" | "same";
export interface DiffLine {
type: DiffLineType;
line: string;
}
export class Problem {
filepath: string;
range: Range;
message: string;
}
export class Thread {
name: string;
id: number;
}
export type IdeType = "vscode" | "jetbrains";
export interface IdeInfo {
ideType: IdeType;
name: string;
version: string;
remoteName: string;
extensionVersion: string;
}
export interface BranchAndDir {
branch: string;
directory: string;
}
export interface IndexTag extends BranchAndDir {
artifactId: string;
}
export enum FileType {
Unkown = 0,
File = 1,
Directory = 2,
SymbolicLink = 64,
}
export interface IdeSettings {
remoteConfigServerUrl: string | undefined;
remoteConfigSyncPeriod: number;
userToken: string;
enableControlServerBeta: boolean;
pauseCodebaseIndexOnStart: boolean;
enableDebugLogs: boolean;
}
export interface IDE {
getIdeInfo(): Promise<IdeInfo>;
getIdeSettings(): Promise<IdeSettings>;
getDiff(): Promise<string>;
isTelemetryEnabled(): Promise<boolean>;
getUniqueId(): Promise<string>;
getTerminalContents(): Promise<string>;
getDebugLocals(threadIndex: number): Promise<string>;
getTopLevelCallStackSources(
threadIndex: number,
stackDepth: number,
): Promise<string[]>;
getAvailableThreads(): Promise<Thread[]>;
listFolders(): Promise<string[]>;
getWorkspaceDirs(): Promise<string[]>;
getWorkspaceConfigs(): Promise<ContinueRcJson[]>;
fileExists(filepath: string): Promise<boolean>;
writeFile(path: string, contents: string): Promise<void>;
showVirtualFile(title: string, contents: string): Promise<void>;
getContinueDir(): Promise<string>;
openFile(path: string): Promise<void>;
runCommand(command: string): Promise<void>;
saveFile(filepath: string): Promise<void>;
readFile(filepath: string): Promise<string>;
readRangeInFile(filepath: string, range: Range): Promise<string>;
showLines(
filepath: string,
startLine: number,
endLine: number,
): Promise<void>;
showDiff(
filepath: string,
newContents: string,
stepIndex: number,
): Promise<void>;
getOpenFiles(): Promise<string[]>;
getCurrentFile(): Promise<string | undefined>;
getPinnedFiles(): Promise<string[]>;
getSearchResults(query: string): Promise<string>;
subprocess(command: string): Promise<[string, string]>;
getProblems(filepath?: string | undefined): Promise<Problem[]>;
getBranch(dir: string): Promise<string>;
getTags(artifactId: string): Promise<IndexTag[]>;
getRepoName(dir: string): Promise<string | undefined>;
showToast(
type: ToastType,
message: string,
...otherParams: any[]
): Promise<any>;
getGitRootPath(dir: string): Promise<string | undefined>;
listDir(dir: string): Promise<[string, FileType][]>;
getLastModified(files: string[]): Promise<{ [path: string]: number }>;
getGitHubAuthToken(args: GetGhTokenArgs): Promise<string | undefined>;
// LSP
gotoDefinition(location: Location): Promise<RangeInFile[]>;
// Callbacks
onDidChangeActiveTextEditor(callback: (filepath: string) => void): void;
pathSep(): Promise<string>;
}
// Slash Commands
export interface ContinueSDK {
ide: IDE;
llm: ILLM;
addContextItem: (item: ContextItemWithId) => void;
history: ChatMessage[];
input: string;
params?: { [key: string]: any } | undefined;
contextItems: ContextItemWithId[];
selectedCode: RangeInFile[];
config: ContinueConfig;
fetch: FetchFunction;
}
export interface SlashCommand {
name: string;
description: string;
params?: { [key: string]: any };
run: (sdk: ContinueSDK) => AsyncGenerator<string | undefined>;
}
// Config
type StepName =
| "AnswerQuestionChroma"
| "GenerateShellCommandStep"
| "EditHighlightedCodeStep"
| "ShareSessionStep"
| "CommentCodeStep"
| "ClearHistoryStep"
| "StackOverflowStep"
| "OpenConfigStep"
| "GenerateShellCommandStep"
| "DraftIssueStep";
type ContextProviderName =
| "diff"
| "github"
| "terminal"
| "locals"
| "open"
| "google"
| "search"
| "tree"
| "http"
| "codebase"
| "problems"
| "folder"
| "jira"
| "postgres"
| "database"
| "code"
| "docs"
| "gitlab-mr"
| "os"
| "currentFile"
| "greptile"
| "outline"
| "continue-proxy"
| "highlights"
| "file"
| "issue"
| "repo-map"
| "url"
| string;
type TemplateType =
| "llama2"
| "alpaca"
| "zephyr"
| "phi2"
| "phind"
| "anthropic"
| "chatml"
| "none"
| "openchat"
| "deepseek"
| "xwin-coder"
| "neural-chat"
| "codellama-70b"
| "llava"
| "gemma"
| "llama3";
type ModelProvider =
| "openai"
| "free-trial"
| "anthropic"
| "cohere"
| "together"
| "ollama"
| "huggingface-tgi"
| "huggingface-inference-api"
| "kindo"
| "llama.cpp"
| "replicate"
| "text-gen-webui"
| "lmstudio"
| "llamafile"
| "gemini"
| "mistral"
| "bedrock"
| "bedrockimport"
| "sagemaker"
| "deepinfra"
| "flowise"
| "groq"
| "continue-proxy"
| "fireworks"
| "custom"
| "cloudflare"
| "deepseek"
| "azure"
| "openai-aiohttp"
| "msty"
| "watsonx"
| "openrouter"
| "sambanova"
| "nvidia"
| "vllm"
| "mock";
export type ModelName =
| "AUTODETECT"
// OpenAI
| "gpt-3.5-turbo"
| "gpt-3.5-turbo-16k"
| "gpt-4"
| "gpt-3.5-turbo-0613"
| "gpt-4-32k"
| "gpt-4o"
| "gpt-4o-mini"
| "gpt-4-turbo"
| "gpt-4-turbo-preview"
| "gpt-4-vision-preview"
// Mistral
| "codestral-latest"
| "open-mistral-7b"
| "open-mixtral-8x7b"
| "open-mixtral-8x22b"
| "mistral-small-latest"
| "mistral-large-latest"
| "mistral-7b"
| "mistral-8x7b"
| "mistral-tiny"
| "mistral-small"
| "mistral-medium"
| "mistral-embed"
// Llama 2
| "llama2-7b"
| "llama2-13b"
| "llama2-70b"
| "codellama-7b"
| "codellama-13b"
| "codellama-34b"
| "codellama-70b"
// Llama 3
| "llama3-8b"
| "llama3-70b"
// Other Open-source
| "phi2"
| "phind-codellama-34b"
| "wizardcoder-7b"
| "wizardcoder-13b"
| "wizardcoder-34b"
| "zephyr-7b"
| "codeup-13b"
| "deepseek-7b"
| "deepseek-33b"
| "neural-chat-7b"
| "gemma-7b-it"
| "gemma2-9b-it"
// Anthropic
| "claude-3-5-sonnet-20240620"
| "claude-3-opus-20240229"
| "claude-3-sonnet-20240229"
| "claude-3-haiku-20240307"
| "claude-2.1"
| "claude-2"
// Cohere
| "command-r"
| "command-r-plus"
// Gemini
| "gemini-pro"
| "gemini-1.5-pro-latest"
| "gemini-1.5-pro"
| "gemini-1.5-flash-latest"
| "gemini-1.5-flash"
// Tab autocomplete
| "deepseek-1b"
| "starcoder-1b"
| "starcoder-3b"
| "starcoder2-3b"
| "stable-code-3b";
export interface RequestOptions {
timeout?: number;
verifySsl?: boolean;
caBundlePath?: string | string[];
proxy?: string;
headers?: { [key: string]: string };
extraBodyProperties?: { [key: string]: any };
noProxy?: string[];
clientCertificate?: ClientCertificateOptions;
}
export interface CacheBehavior {
cacheSystemMessage?: boolean;
cacheConversation?: boolean;
}
export interface ClientCertificateOptions {
cert: string;
key: string;
passphrase?: string;
}
export interface StepWithParams {
name: StepName;
params: { [key: string]: any };
}
export interface ContextProviderWithParams {
name: ContextProviderName;
params: { [key: string]: any };
}
export interface SlashCommandDescription {
name: string;
description: string;
params?: { [key: string]: any };
}
export interface CustomCommand {
name: string;
prompt: string;
description: string;
}
interface BaseCompletionOptions {
temperature?: number;
topP?: number;
topK?: number;
minP?: number;
presencePenalty?: number;
frequencyPenalty?: number;
mirostat?: number;
stop?: string[];
maxTokens?: number;
numThreads?: number;
keepAlive?: number;
raw?: boolean;
stream?: boolean;
}
export interface ModelCapability {
uploadImage?: boolean;
}
export interface ModelDescription {
title: string;
provider: ModelProvider;
model: string;
apiKey?: string;
apiBase?: string;
contextLength?: number;
maxStopWords?: number;
template?: TemplateType;
completionOptions?: BaseCompletionOptions;
systemMessage?: string;
requestOptions?: RequestOptions;
promptTemplates?: { [key: string]: string };
capabilities?: ModelCapability;
cacheBehavior?: CacheBehavior;
}
export type EmbeddingsProviderName =
| "bedrock"
| "huggingface-tei"
| "transformers.js"
| "ollama"
| "openai"
| "cohere"
| "free-trial"
| "gemini"
| "continue-proxy"
| "deepinfra"
| "nvidia"
| "voyage"
| "mistral";
export interface EmbedOptions {
apiBase?: string;
apiKey?: string;
model?: string;
engine?: string;
apiType?: string;
apiVersion?: string;
requestOptions?: RequestOptions;
maxChunkSize?: number;
maxBatchSize?: number;
// AWS options
profile?: string;
// AWS and GCP Options
region?: string;
}
export interface EmbeddingsProviderDescription extends EmbedOptions {
provider: EmbeddingsProviderName;
}
export interface EmbeddingsProvider {
id: string;
providerName: EmbeddingsProviderName;
maxChunkSize: number;
embed(chunks: string[]): Promise<number[][]>;
}
export type RerankerName =
| "cohere"
| "voyage"
| "llm"
| "free-trial"
| "huggingface-tei"
| "continue-proxy";
export interface RerankerDescription {
name: RerankerName;
params?: { [key: string]: any };
}
export interface Reranker {
name: string;
rerank(query: string, chunks: Chunk[]): Promise<number[]>;
}
export interface TabAutocompleteOptions {
disable: boolean;
useCopyBuffer: boolean;
useFileSuffix: boolean;
maxPromptTokens: number;
debounceDelay: number;
maxSuffixPercentage: number;
prefixPercentage: number;
template?: string;
multilineCompletions: "always" | "never" | "auto";
slidingWindowPrefixPercentage: number;
slidingWindowSize: number;
maxSnippetPercentage: number;
recentlyEditedSimilarityThreshold: number;
useCache: boolean;
onlyMyCode: boolean;
useOtherFiles: boolean;
useRecentlyEdited: boolean;
recentLinePrefixMatchMinLength: number;
disableInFiles?: string[];
useImports?: boolean;
useRootPathContext?: boolean;
}
export interface ContinueUIConfig {
codeBlockToolbarPosition?: "top" | "bottom";
fontSize?: number;
displayRawMarkdown?: boolean;
showChatScrollbar?: boolean;
}
interface ContextMenuConfig {
comment?: string;
docstring?: string;
fix?: string;
optimize?: string;
fixGrammar?: string;
}
interface ModelRoles {
inlineEdit?: string;
applyCodeBlock?: string;
repoMapFileSelection?: string;
}
/**
* Represents the configuration for a quick action in the Code Lens.
* Quick actions are custom commands that can be added to function and class declarations.
*/
interface QuickActionConfig {
/**
* The title of the quick action that will display in the Code Lens.
*/
title: string;
/**
* The prompt that will be sent to the model when the quick action is invoked,
* with the function or class body concatenated.
*/
prompt: string;
/**
* If `true`, the result of the quick action will be sent to the chat panel.
* If `false`, the streamed result will be inserted into the document.
*
* Defaults to `false`.
*/
sendToChat: boolean;
}
export type DefaultContextProvider = ContextProviderWithParams & {
query?: string;
};
interface ExperimentalConfig {
contextMenuPrompts?: ContextMenuConfig;
modelRoles?: ModelRoles;
defaultContext?: DefaultContextProvider[];
promptPath?: string;
/**
* Quick actions are a way to add custom commands to the Code Lens of
* function and class declarations.
*/
quickActions?: QuickActionConfig[];
/**
* Automatically read LLM chat responses aloud using system TTS models
*/
readResponseTTS?: boolean;
/**
* If set to true, we will attempt to pull down and install an instance of Chromium
* that is compatible with the current version of Puppeteer.
* This is needed to crawl a large number of documentation sites that are dynamically rendered.
*/
useChromiumForDocsCrawling?: boolean;
}
interface AnalyticsConfig {
type: string;
url?: string;
clientKey?: string;
}
// config.json
export interface SerializedContinueConfig {
env?: string[];
allowAnonymousTelemetry?: boolean;
models: ModelDescription[];
systemMessage?: string;
completionOptions?: BaseCompletionOptions;
requestOptions?: RequestOptions;
slashCommands?: SlashCommandDescription[];
customCommands?: CustomCommand[];
contextProviders?: ContextProviderWithParams[];
disableIndexing?: boolean;
disableSessionTitles?: boolean;
userToken?: string;
embeddingsProvider?: EmbeddingsProviderDescription;
tabAutocompleteModel?: ModelDescription | ModelDescription[];
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
ui?: ContinueUIConfig;
reranker?: RerankerDescription;
experimental?: ExperimentalConfig;
analytics?: AnalyticsConfig;
docs?: SiteIndexingConfig[];
}
export type ConfigMergeType = "merge" | "overwrite";
export type ContinueRcJson = Partial<SerializedContinueConfig> & {
mergeBehavior: ConfigMergeType;
};
// config.ts - give users simplified interfaces
export interface Config {