Elffuss BraidHub

kikocis/continue public

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