Elffuss BraidHub

kikocis/continue public

b5eb3b80fa0e · 6.1 KiBRawPermalink
1import {
2 BlockType,
3 ConfigResult,
4 DevDataLogEvent,
5 ModelRole,
6} from "@continuedev/config-yaml";
7
8import { AutocompleteInput } from "../autocomplete/util/types";
9import { SharedConfigSchema } from "../config/sharedConfig";
10import { GlobalContextModelSelections } from "../util/GlobalContext";
11
12import type {
13 BrowserSerializedContinueConfig,
14 ChatMessage,
15 ContextItem,
16 ContextItemWithId,
17 ContextSubmenuItem,
18 DiffLine,
19 DocsIndexingDetails,
20 ExperimentalModelRoles,
21 FileSymbolMap,
22 IdeSettings,
23 LLMFullCompletionOptions,
24 ModelDescription,
25 PromptLog,
26 RangeInFile,
27 SerializedContinueConfig,
28 Session,
29 SessionMetadata,
30 SiteIndexingConfig,
31 SlashCommandDescription,
32 ToolCall,
33} from "../";
34import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager";
35import { ControlPlaneSessionInfo } from "../control-plane/client";
36
37export type OnboardingModes = "Local" | "Best" | "Custom" | "Quickstart";
38
39export interface ListHistoryOptions {
40 offset?: number;
41 limit?: number;
42}
43
44export type ToCoreFromIdeOrWebviewProtocol = {
45 // Special
46 ping: [string, string];
47 abort: [undefined, void];
48
49 // History
50 "history/list": [ListHistoryOptions, SessionMetadata[]];
51 "history/delete": [{ id: string }, void];
52 "history/load": [{ id: string }, Session];
53 "history/save": [Session, void];
54 "history/clear": [undefined, void];
55 "devdata/log": [DevDataLogEvent, void];
56 "config/addOpenAiKey": [string, void];
57 "config/addModel": [
58 {
59 model: SerializedContinueConfig["models"][number];
60 role?: keyof ExperimentalModelRoles;
61 },
62 void,
63 ];
64 "config/addLocalWorkspaceBlock": [{ blockType: BlockType }, void];
65 "config/newPromptFile": [undefined, void];
66 "config/ideSettingsUpdate": [IdeSettings, void];
67 "config/getSerializedProfileInfo": [
68 undefined,
69 {
70 result: ConfigResult<BrowserSerializedContinueConfig>;
71 profileId: string | null;
72 organizations: SerializedOrgWithProfiles[];
73 selectedOrgId: string;
74 },
75 ];
76 "config/deleteModel": [{ title: string }, void];
77 "config/reload": [undefined, ConfigResult<BrowserSerializedContinueConfig>];
78 "config/refreshProfiles": [
79 (
80 | undefined
81 | {
82 selectOrgId?: string;
83 selectProfileId?: string;
84 }
85 ),
86 void,
87 ];
88 "config/openProfile": [{ profileId: string | undefined }, void];
89 "config/updateSharedConfig": [SharedConfigSchema, SharedConfigSchema];
90 "config/updateSelectedModel": [
91 {
92 profileId: string;
93 role: ModelRole;
94 title: string | null;
95 },
96 GlobalContextModelSelections,
97 ];
98 "context/getContextItems": [
99 {
100 name: string;
101 query: string;
102 fullInput: string;
103 selectedCode: RangeInFile[];
104 },
105 ContextItemWithId[],
106 ];
107 "mcp/reloadServer": [
108 {
109 id: string;
110 },
111 void,
112 ];
113 "context/getSymbolsForFiles": [{ uris: string[] }, FileSymbolMap];
114 "context/loadSubmenuItems": [{ title: string }, ContextSubmenuItem[]];
115 "autocomplete/complete": [AutocompleteInput, string[]];
116 "context/addDocs": [SiteIndexingConfig, void];
117 "context/removeDocs": [Pick<SiteIndexingConfig, "startUrl">, void];
118 "context/indexDocs": [{ reIndex: boolean }, void];
119 "autocomplete/cancel": [undefined, void];
120 "autocomplete/accept": [{ completionId: string }, void];
121 "llm/complete": [
122 {
123 prompt: string;
124 completionOptions: LLMFullCompletionOptions;
125 title: string;
126 },
127 string,
128 ];
129 "llm/listModels": [{ title: string }, string[] | undefined];
130 "llm/streamChat": [
131 {
132 messages: ChatMessage[];
133 completionOptions: LLMFullCompletionOptions;
134 title: string;
135 legacySlashCommandData?: {
136 command: SlashCommandDescription;
137 input: string;
138 contextItems: ContextItemWithId[];
139 historyIndex: number;
140 selectedCode: RangeInFile[];
141 };
142 },
143 AsyncGenerator<ChatMessage, PromptLog>,
144 ];
145 streamDiffLines: [
146 {
147 prefix: string;
148 highlighted: string;
149 suffix: string;
150 input: string;
151 language: string | undefined;
152 modelTitle: string | undefined;
153 includeRulesInSystemMessage: boolean;
154 },
155 AsyncGenerator<DiffLine>,
156 ];
157 "chatDescriber/describe": [
158 {
159 text: string;
160 },
161 string | undefined,
162 ];
163 "stats/getTokensPerDay": [
164 undefined,
165 { day: string; promptTokens: number; generatedTokens: number }[],
166 ];
167 "stats/getTokensPerModel": [
168 undefined,
169 { model: string; promptTokens: number; generatedTokens: number }[],
170 ];
171 "tts/kill": [undefined, void];
172
173 // Codebase indexing
174 "index/setPaused": [boolean, void];
175 "index/forceReIndex": [
176 undefined | { dirs?: string[]; shouldClearIndexes?: boolean },
177 void,
178 ];
179 "index/indexingProgressBarInitialized": [undefined, void];
180 completeOnboarding: [
181 {
182 mode: OnboardingModes;
183 },
184 void,
185 ];
186
187 // File changes
188 "files/changed": [{ uris?: string[] }, void];
189 "files/opened": [{ uris?: string[] }, void];
190 "files/created": [{ uris?: string[] }, void];
191 "files/deleted": [{ uris?: string[] }, void];
192 "files/closed": [{ uris?: string[] }, void];
193
194 // Docs etc. Indexing. TODO move codebase to this
195 "indexing/reindex": [{ type: string; id: string }, void];
196 "indexing/abort": [{ type: string; id: string }, void];
197 "indexing/setPaused": [{ type: string; id: string; paused: boolean }, void];
198 "docs/getSuggestedDocs": [undefined, void];
199 "docs/initStatuses": [undefined, void];
200 "docs/getDetails": [{ startUrl: string }, DocsIndexingDetails];
201 addAutocompleteModel: [{ model: ModelDescription }, void];
202
203 "auth/getAuthUrl": [{ useOnboarding: boolean }, { url: string }];
204 "tools/call": [
205 { toolCall: ToolCall },
206 { contextItems: ContextItem[]; errorMessage?: string },
207 ];
208 "clipboardCache/add": [{ content: string }, void];
209 "controlPlane/openUrl": [{ path: string; orgSlug: string | undefined }, void];
210 isItemTooBig: [{ item: ContextItemWithId }, boolean];
211 didChangeControlPlaneSessionInfo: [
212 { sessionInfo: ControlPlaneSessionInfo | undefined },
213 void,
214 ];
215 "process/markAsBackgrounded": [{ toolCallId: string }, void];
216 "process/isBackgrounded": [{ toolCallId: string }, boolean];
217};