From 8a84ab221f147f48e5253219a72c8303afa46ed1 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 11 Dec 2024 11:27:01 -0800 Subject: [PATCH] update types.ts --- core/config/types.ts | 841 +++++++++++++++++++++++++++---------------- 1 file changed, 522 insertions(+), 319 deletions(-) diff --git a/core/config/types.ts b/core/config/types.ts index 668cb3685..60a2ae8dc 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -1,5 +1,30 @@ const Types = ` declare global { + import Parser from "web-tree-sitter"; + 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; @@ -7,34 +32,56 @@ declare global { 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"; + status: + | "loading" + | "indexing" + | "done" + | "failed" + | "paused" + | "disabled" + | "cancelled"; debugInfo?: string; } - - export type PromptTemplate = - | string - | (( - history: ChatMessage[], - otherData: Record, - ) => string | ChatMessage[]); - + + // This is more or less a V2 of IndexingProgressUpdate for docs etc. + export interface IndexingStatus { + id: string; + type: "docs"; + progress: number; + description: string; + status: "indexing" | "complete" | "paused" | "failed" | "aborted" | "pending"; + embeddingsProviderId: string; + isReindexing?: boolean; + debugInfo?: string; + title: string; + icon?: string; + url?: string; + } + + export type PromptTemplateFunction = ( + history: ChatMessage[], + otherData: Record, + ) => string | ChatMessage[]; + + export type PromptTemplate = string | PromptTemplateFunction; + export interface ILLM extends LLMOptions { - get providerName(): ModelProvider; - + get providerName(): string; + uniqueId: string; model: string; - + title?: string; systemMessage?: string; contextLength: number; @@ -48,48 +95,65 @@ declare global { apiKey?: string; apiBase?: string; cacheBehavior?: CacheBehavior; - + deployment?: string; apiVersion?: string; apiType?: string; region?: string; projectId?: string; - - complete(prompt: string, options?: LLMFullCompletionOptions): Promise; - + + // Embedding options + embeddingId: string; + maxEmbeddingChunkSize: number; + maxEmbeddingBatchSize: number; + + complete( + prompt: string, + signal: AbortSignal, + options?: LLMFullCompletionOptions, + ): Promise; + streamComplete( prompt: string, + signal: AbortSignal, options?: LLMFullCompletionOptions, ): AsyncGenerator; - + streamFim( prefix: string, suffix: string, + signal: AbortSignal, options?: LLMFullCompletionOptions, ): AsyncGenerator; - + streamChat( messages: ChatMessage[], + signal: AbortSignal, options?: LLMFullCompletionOptions, ): AsyncGenerator; - + chat( messages: ChatMessage[], + signal: AbortSignal, options?: LLMFullCompletionOptions, ): Promise; - + + embed(chunks: string[]): Promise; + + rerank(query: string, chunks: Chunk[]): Promise; + countTokens(text: string): number; - + supportsImages(): boolean; - + supportsCompletions(): boolean; - + supportsPrefill(): boolean; - + supportsFim(): boolean; - + listModels(): Promise; - + renderPromptTemplate( template: PromptTemplate, history: ChatMessage[], @@ -97,51 +161,54 @@ declare global { canPutWordsInModelsMouth?: boolean, ): string | ChatMessage[]; } - + export type ContextProviderType = "normal" | "query" | "submenu"; - + export interface ContextProviderDescription { - title: string; + title: ContextProviderName; displayTitle: string; description: string; renderInlineAs?: string; type: ContextProviderType; + dependsOnIndexing?: boolean; } - + export type FetchFunction = (url: string | URL, init?: any) => Promise; - + export interface ContextProviderExtras { config: ContinueConfig; fullInput: string; - embeddingsProvider: EmbeddingsProvider; - reranker: Reranker | undefined; + embeddingsProvider: ILLM; + reranker: ILLM | 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; + loadSubmenuItems?: ( args: LoadSubmenuItemsArgs, ) => Promise; } - + export interface ContextSubmenuItem { id: string; title: string; @@ -149,7 +216,7 @@ declare global { icon?: string; metadata?: any; } - + export interface SiteIndexingConfig { title: string; startUrl: string; @@ -157,97 +224,151 @@ declare global { 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; - + loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise; } - + + export interface Checkpoint { + [filepath: string]: string; + } + export interface Session { - history: ChatHistory; + sessionId: string; title: string; workspaceDirectory: string; - sessionId: string; + history: ChatHistoryItem[]; } - - export interface SessionInfo { + + export interface SessionMetadata { 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 type ChatMessageRole = "user" | "assistant" | "system" | "tool"; + export interface MessagePart { type: "text" | "imageUrl"; text?: string; imageUrl?: { url: string }; } - + export type MessageContent = string | MessagePart[]; - - export interface ChatMessage { - role: ChatMessageRole; + + export interface ToolCall { + id: string; + type: "function"; + function: { + name: string; + arguments: string; + }; + } + + export interface ToolCallDelta { + id?: string; + type?: "function"; + function?: { + name?: string; + arguments?: string; + }; + } + + export interface ToolResultChatMessage { + role: "tool"; + content: string; + toolCallId: string; + } + + export interface UserChatMessage { + role: "user"; content: MessageContent; } - + + export interface AssistantChatMessage { + role: "assistant"; + content: MessageContent; + toolCalls?: ToolCallDelta[]; + } + + export interface SystemChatMessage { + role: "system"; + content: string; + } + + export type ChatMessage = + | UserChatMessage + | AssistantChatMessage + | SystemChatMessage + | ToolResultChatMessage; + 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; @@ -255,50 +376,74 @@ declare global { editing?: boolean; editable?: boolean; icon?: string; + uri?: ContextItemUri; + hidden?: boolean; } - - export interface ContextItemWithId { - content: string; - name: string; - description: string; + + export interface ContextItemWithId extends ContextItem { id: ContextItemId; - editing?: boolean; - editable?: boolean; - icon?: string; } - + export interface InputModifiers { useCodebase: boolean; noContext: boolean; } - + + export interface SymbolWithRange extends RangeInFile { + name: string; + type: Parser.SyntaxNode["type"]; + content: string; + } + + export type FileSymbolMap = Record; + export interface PromptLog { modelTitle: string; completionOptions: CompletionOptions; prompt: string; completion: string; } - + + type MessageModes = "chat" | "edit"; + + export type ToolStatus = + | "generating" + | "generated" + | "calling" + | "done" + | "canceled"; + + // Will exist only on "assistant" messages with tool calls + interface ToolCallState { + toolCallId: string; + toolCall: ToolCall; + status: ToolStatus; + parsedArgs: any; + output?: ContextItem[]; + } + export interface ChatHistoryItem { message: ChatMessage; + contextItems: ContextItemWithId[]; editorState?: any; modifiers?: InputModifiers; - contextItems: ContextItemWithId[]; promptLogs?: PromptLog[]; + toolCallState?: ToolCallState; + isGatheringContext?: boolean; + checkpoint?: Checkpoint; + isBeforeCheckpoint?: boolean; } - - 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; @@ -315,31 +460,39 @@ declare global { aiGatewaySlug?: string; apiBase?: string; cacheBehavior?: CacheBehavior; - + useLegacyCompletionsEndpoint?: boolean; - + + // Embedding options + embeddingId?: string; + maxEmbeddingChunkSize?: number; + maxEmbeddingBatchSize?: number; + // Cloudflare options accountId?: string; - + // Azure options deployment?: 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 + + // GCP and Watsonx Options + projectId?: string; + + // IBM watsonx Options deploymentId?: string; } + type RequireAtLeastOne = Pick< T, Exclude @@ -347,16 +500,18 @@ declare global { { [K in Keys]-?: Required> & Partial>>; }[Keys]; - + export interface CustomLLMWithOptionals { options: LLMOptions; streamCompletion?: ( prompt: string, + signal: AbortSignal, options: CompletionOptions, fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise, ) => AsyncGenerator; streamChat?: ( messages: ChatMessage[], + signal: AbortSignal, options: CompletionOptions, fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise, ) => AsyncGenerator; @@ -364,7 +519,7 @@ declare global { fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise, ) => Promise; } - + /** * The LLM interface requires you to specify either \`streamCompletion\` or \`streamChat\` (or both). */ @@ -372,28 +527,29 @@ declare global { 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; @@ -401,23 +557,23 @@ declare global { 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; @@ -426,73 +582,119 @@ declare global { pauseCodebaseIndexOnStart: boolean; enableDebugLogs: boolean; } - + export interface IDE { getIdeInfo(): Promise; + getIdeSettings(): Promise; - getDiff(includeUnstaged: boolean): Promise; + + getDiff(includeUnstaged: boolean): Promise; + + getClipboardContent(): Promise<{ text: string; copiedAt: string }>; + isTelemetryEnabled(): Promise; + getUniqueId(): Promise; + getTerminalContents(): Promise; + getDebugLocals(threadIndex: number): Promise; + getTopLevelCallStackSources( threadIndex: number, stackDepth: number, ): Promise; + getAvailableThreads(): Promise; + listFolders(): Promise; + getWorkspaceDirs(): Promise; + getWorkspaceConfigs(): Promise; + fileExists(filepath: string): Promise; + writeFile(path: string, contents: string): Promise; + showVirtualFile(title: string, contents: string): Promise; + getContinueDir(): Promise; + openFile(path: string): Promise; + + openUrl(url: string): Promise; + runCommand(command: string): Promise; + saveFile(filepath: string): Promise; + readFile(filepath: string): Promise; + readRangeInFile(filepath: string, range: Range): Promise; + showLines( filepath: string, startLine: number, endLine: number, ): Promise; + showDiff( filepath: string, newContents: string, stepIndex: number, ): Promise; + getOpenFiles(): Promise; - getCurrentFile(): Promise; + + getCurrentFile(): Promise< + | undefined + | { + isUntitled: boolean; + path: string; + contents: string; + } + >; + getPinnedFiles(): Promise; + getSearchResults(query: string): Promise; - subprocess(command: string): Promise<[string, string]>; + + subprocess(command: string, cwd?: string): Promise<[string, string]>; + getProblems(filepath?: string | undefined): Promise; + getBranch(dir: string): Promise; + getTags(artifactId: string): Promise; + getRepoName(dir: string): Promise; - errorPopup(message: string): Promise; - infoPopup(message: string): Promise; - + + showToast( + type: ToastType, + message: string, + ...otherParams: any[] + ): Promise; + getGitRootPath(dir: string): Promise; + listDir(dir: string): Promise<[string, FileType][]>; + getLastModified(files: string[]): Promise<{ [path: string]: number }>; - getGitHubAuthToken(): Promise; - + + getGitHubAuthToken(args: GetGhTokenArgs): Promise; + // LSP gotoDefinition(location: Location): Promise; - + // Callbacks onDidChangeActiveTextEditor(callback: (filepath: string) => void): void; + pathSep(): Promise; } - + // Slash Commands - + export interface ContinueSDK { ide: IDE; llm: ILLM; @@ -505,16 +707,16 @@ declare global { config: ContinueConfig; fetch: FetchFunction; } - + export interface SlashCommand { name: string; description: string; params?: { [key: string]: any }; run: (sdk: ContinueSDK) => AsyncGenerator; } - + // Config - + type StepName = | "AnswerQuestionChroma" | "GenerateShellCommandStep" @@ -526,7 +728,7 @@ declare global { | "OpenConfigStep" | "GenerateShellCommandStep" | "DraftIssueStep"; - + type ContextProviderName = | "diff" | "github" @@ -542,15 +744,22 @@ declare global { | "folder" | "jira" | "postgres" - | "mssql" | "database" | "code" | "docs" | "gitlab-mr" | "os" | "currentFile" - | "greptile"; - + | "greptile" + | "outline" + | "continue-proxy" + | "highlights" + | "file" + | "issue" + | "repo-map" + | "url" + | string; + type TemplateType = | "llama2" | "alpaca" @@ -567,128 +776,9 @@ declare global { | "codellama-70b" | "llava" | "gemma" + | "granite" | "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" - | "nebius" - | "siliconflow" - | "scaleway"; - - 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-8x22b" - | "mistral-tiny" - | "mistral-small" - | "mistral-medium" - | "mistral-nemo" - // 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" - | "phi-3-mini" - | "phi-3-medium" - | "phind-codellama-34b" - | "wizardcoder-7b" - | "wizardcoder-13b" - | "wizardcoder-34b" - | "zephyr-7b" - | "codeup-13b" - | "deepseek-7b" - | "deepseek-33b" - | "deepseek-2-lite" - | "neural-chat-7b" - | "gemma-7b-it" - | "gemma2-2b-it" - | "gemma2-9b-it" - | "olmo-7b" - | "qwen25-coder-32b" - // Anthropic - | "claude-3-5-sonnet-latest" - | "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; @@ -699,40 +789,71 @@ declare global { 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 Prediction { + type: "content"; + content: + | string + | { + type: "text"; + text: string; + }[]; + } + + export interface ToolExtras { + ide: IDE; + llm: ILLM; + fetch: FetchFunction; + } + + export interface Tool { + type: "function"; + function: { + name: string; + description?: string; + parameters?: Record; + strict?: boolean | null; + }; + + displayTitle: string; + wouldLikeTo: string; + readonly: boolean; + uri?: string; + } + interface BaseCompletionOptions { temperature?: number; topP?: number; @@ -748,15 +869,17 @@ declare global { keepAlive?: number; raw?: boolean; stream?: boolean; + prediction?: Prediction; + tools?: Tool[]; } - + export interface ModelCapability { uploadImage?: boolean; } - + export interface ModelDescription { title: string; - provider: ModelProvider; + provider: string; model: string; apiKey?: string; apiBase?: string; @@ -770,21 +893,7 @@ declare global { capabilities?: ModelCapability; cacheBehavior?: CacheBehavior; } - - export type EmbeddingsProviderName = - | "huggingface-tei" - | "transformers.js" - | "ollama" - | "openai" - | "cohere" - | "free-trial" - | "gemini" - | "continue-proxy" - | "deepinfra" - | "voyage" - | "watsonx" - | "nebius"; - + export interface EmbedOptions { apiBase?: string; apiKey?: string; @@ -794,38 +903,26 @@ declare global { apiVersion?: string; requestOptions?: RequestOptions; maxChunkSize?: number; + maxBatchSize?: number; + // AWS options + profile?: string; + + // AWS and GCP Options + region?: string; + + // GCP and Watsonx Options projectId?: string; } - + export interface EmbeddingsProviderDescription extends EmbedOptions { - provider: EmbeddingsProviderName; + provider: string; } - - export interface EmbeddingsProvider { - id: string; - providerName: EmbeddingsProviderName; - maxChunkSize: number; - embed(chunks: string[]): Promise; - } - - export type RerankerName = - | "cohere" - | "voyage" - | "llm" - | "free-trial" - | "huggingface-tei" - | "continue-proxy"; - + export interface RerankerDescription { - name: RerankerName; + name: string; params?: { [key: string]: any }; } - - export interface Reranker { - name: string; - rerank(query: string, chunks: Chunk[]): Promise; - } - + export interface TabAutocompleteOptions { disable: boolean; useFileSuffix: boolean; @@ -833,6 +930,7 @@ declare global { debounceDelay: number; maxSuffixPercentage: number; prefixPercentage: number; + transform?: boolean; template?: string; multilineCompletions: "always" | "never" | "auto"; slidingWindowPrefixPercentage: number; @@ -842,15 +940,40 @@ declare global { useRecentlyEdited: boolean; disableInFiles?: string[]; useImports?: boolean; + showWhateverWeHaveAtXMs?: number; } - + + interface StdioOptions { + type: "stdio"; + command: string; + args: string[]; + } + + interface WebSocketOptions { + type: "websocket"; + url: string; + } + + interface SSEOptions { + type: "sse"; + url: string; + } + + type TransportOptions = StdioOptions | WebSocketOptions | SSEOptions; + + export interface MCPOptions { + transport: TransportOptions; + } + export interface ContinueUIConfig { codeBlockToolbarPosition?: "top" | "bottom"; fontSize?: number; displayRawMarkdown?: boolean; + showChatScrollbar?: boolean; + getChatTitles?: boolean; codeWrap?: boolean; } - + interface ContextMenuConfig { comment?: string; docstring?: string; @@ -858,12 +981,44 @@ declare global { optimize?: string; fixGrammar?: string; } - + interface ModelRoles { inlineEdit?: string; applyCodeBlock?: string; + repoMapFileSelection?: string; } - + + export type EditStatus = + | "not-started" + | "streaming" + | "accepting" + | "accepting:full-diff" + | "done"; + + export type ApplyStateStatus = + | "streaming" // Changes are being applied to the file + | "done" // All changes have been applied, awaiting user to accept/reject + | "closed"; // All changes have been applied. Note that for new files, we immediately set the status to "closed" + + export interface ApplyState { + streamId: string; + status?: ApplyStateStatus; + numDiffs?: number; + filepath?: string; + fileContent?: string; + } + + export interface RangeInFileWithContents { + filepath: string; + range: { + start: { line: number; character: number }; + end: { line: number; character: number }; + }; + contents: string; + } + + export type CodeToEdit = RangeInFileWithContents | FileWithContents; + /** * 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. @@ -873,13 +1028,13 @@ declare global { * 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. @@ -888,35 +1043,44 @@ declare global { */ 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; + useTools?: boolean; + modelContextProtocolServers?: MCPOptions[]; } - + interface AnalyticsConfig { type: string; url?: string; clientKey?: string; } - + // config.json export interface SerializedContinueConfig { env?: string[]; @@ -940,13 +1104,13 @@ declare global { analytics?: AnalyticsConfig; docs?: SiteIndexingConfig[]; } - + export type ConfigMergeType = "merge" | "overwrite"; - + export type ContinueRcJson = Partial & { mergeBehavior: ConfigMergeType; }; - + // config.ts - give users simplified interfaces export interface Config { /** If set to true, Continue will collect anonymous usage data to improve the product. If set to false, we will collect nothing. Read here to learn more: https://docs.continue.dev/telemetry */ @@ -975,7 +1139,7 @@ declare global { /** An optional token to identify a user. Not used by Continue unless you write custom coniguration that requires such a token */ userToken?: string; /** The provider used to calculate embeddings. If left empty, Continue will use transformers.js to calculate the embeddings with all-MiniLM-L6-v2 */ - embeddingsProvider?: EmbeddingsProviderDescription | EmbeddingsProvider; + embeddingsProvider?: EmbeddingsProviderDescription | ILLM; /** The model that Continue will use for tab autocompletions. */ tabAutocompleteModel?: | CustomLLM @@ -986,13 +1150,13 @@ declare global { /** UI styles customization */ ui?: ContinueUIConfig; /** Options for the reranker */ - reranker?: RerankerDescription | Reranker; + reranker?: RerankerDescription | ILLM; /** Experimental configuration */ experimental?: ExperimentalConfig; /** Analytics configuration */ analytics?: AnalyticsConfig; } - + // in the actual Continue source code export interface ContinueConfig { allowAnonymousTelemetry?: boolean; @@ -1005,16 +1169,17 @@ declare global { disableSessionTitles?: boolean; disableIndexing?: boolean; userToken?: string; - embeddingsProvider: EmbeddingsProvider; + embeddingsProvider: ILLM; tabAutocompleteModels?: ILLM[]; tabAutocompleteOptions?: Partial; ui?: ContinueUIConfig; - reranker?: Reranker; + reranker?: ILLM; experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; docs?: SiteIndexingConfig[]; + tools: Tool[]; } - + export interface BrowserSerializedContinueConfig { allowAnonymousTelemetry?: boolean; models: ModelDescription[]; @@ -1031,8 +1196,46 @@ declare global { reranker?: RerankerDescription; experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; + docs?: SiteIndexingConfig[]; + tools: Tool[]; } - + + // DOCS SUGGESTIONS AND PACKAGE INFO + export interface FilePathAndName { + path: string; + name: string; + } + + export interface PackageFilePathAndName extends FilePathAndName { + packageRegistry: string; // e.g. npm, pypi + } + + export type ParsedPackageInfo = { + name: string; + packageFile: PackageFilePathAndName; + language: string; + version: string; + }; + + export type PackageDetails = { + docsLink?: string; + docsLinkWarning?: string; + title?: string; + description?: string; + repo?: string; + license?: string; + }; + + export type PackageDetailsSuccess = PackageDetails & { + docsLink: string; + }; + + export type PackageDocsResult = { + packageInfo: ParsedPackageInfo; + } & ( + | { error: string; details?: never } + | { details: PackageDetailsSuccess; error?: never } + ); } export {};