Elffuss BraidHub

kikocis/continue public

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