Elffuss BraidHub

kikocis/continue public

c53d47aeb2c4 · 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 {
13 BrowserSerializedContinueConfig,
14 ChatMessage,
15 CompleteOnboardingPayload,
16 ContextItem,
17 ContextItemWithId,
18 ContextSubmenuItem,
19 DiffLine,
20 DocsIndexingDetails,
21 ExperimentalModelRoles,
22 FileSymbolMap,
23 IdeSettings,
24 LLMFullCompletionOptions,
25 ModelDescription,
26 PromptLog,
27 RangeInFile,
28 SerializedContinueConfig,
29 Session,
30 SessionMetadata,
31 SiteIndexingConfig,
32 SlashCommandDescription,
33 StreamDiffLinesPayload,
34 ToolCall,
35} from "../";
36import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager";
37import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes";
38import { FreeTrialStatus } from "../control-plane/client";
39
40export enum OnboardingModes {
41 API_KEY = "API Key",
42 LOCAL = "Local",
43}
44
45export interface ListHistoryOptions {
46 offset?: number;
47 limit?: number;
48}
49
50export type ToCoreFromIdeOrWebviewProtocol = {
51 // Special
52 ping: [string, string];
53 abort: [undefined, void];
54 cancelApply: [undefined, void];
55
56 // History
57 "history/list": [ListHistoryOptions, SessionMetadata[]];
58 "history/delete": [{ id: string }, void];
59 "history/load": [{ id: string }, Session];
60 "history/save": [Session, void];
61 "history/clear": [undefined, void];
62 "devdata/log": [DevDataLogEvent, void];
63 "config/addOpenAiKey": [string, void];
64 "config/addModel": [
65 {
66 model: SerializedContinueConfig["models"][number];
67 role?: keyof ExperimentalModelRoles;
68 },
69 void,
70 ];
71 "config/addLocalWorkspaceBlock": [{ blockType: BlockType }, void];
72 "config/newPromptFile": [undefined, void];
73 "config/ideSettingsUpdate": [IdeSettings, void];
74 "config/getSerializedProfileInfo": [
75 undefined,
76 {
77 result: ConfigResult<BrowserSerializedContinueConfig>;
78 profileId: string | null;
79 organizations: SerializedOrgWithProfiles[];
80 selectedOrgId: string;
81 },
82 ];
83 "config/deleteModel": [{ title: string }, void];
84 "config/reload": [undefined, ConfigResult<BrowserSerializedContinueConfig>];
85 "config/refreshProfiles": [
86 (
87 | undefined
88 | {
89 selectOrgId?: string;
90 selectProfileId?: string;
91 }
92 ),
93 void,
94 ];
95 "config/openProfile": [{ profileId: string | undefined }, void];
96 "config/updateSharedConfig": [SharedConfigSchema, SharedConfigSchema];
97 "config/updateSelectedModel": [
98 {
99 profileId: string;
100 role: ModelRole;
101 title: string | null;
102 },
103 GlobalContextModelSelections,
104 ];
105 "context/getContextItems": [
106 {
107 name: string;
108 query: string;
109 fullInput: string;
110 selectedCode: RangeInFile[];
111 },
112 ContextItemWithId[],
113 ];
114 "mcp/reloadServer": [
115 {
116 id: string;
117 },
118 void,
119 ];
120 "context/getSymbolsForFiles": [{ uris: string[] }, FileSymbolMap];
121 "context/loadSubmenuItems": [{ title: string }, ContextSubmenuItem[]];
122 "autocomplete/complete": [AutocompleteInput, string[]];
123 "context/addDocs": [SiteIndexingConfig, void];
124 "context/removeDocs": [Pick<SiteIndexingConfig, "startUrl">, void];
125 "context/indexDocs": [{ reIndex: boolean }, void];
126 "autocomplete/cancel": [undefined, void];
127 "autocomplete/accept": [{ completionId: string }, void];
128 "llm/complete": [
129 {
130 prompt: string;
131 completionOptions: LLMFullCompletionOptions;
132 title: string;
133 },
134 string,
135 ];
136 "llm/listModels": [{ title: string }, string[] | undefined];
137 "llm/streamChat": [
138 {
139 messages: ChatMessage[];
140 completionOptions: LLMFullCompletionOptions;
141 title: string;
142 legacySlashCommandData?: {
143 command: SlashCommandDescription;
144 input: string;
145 contextItems: ContextItemWithId[];
146 historyIndex: number;
147 selectedCode: RangeInFile[];
148 };
149 },
150 AsyncGenerator<ChatMessage, PromptLog>,
151 ];
152 streamDiffLines: [StreamDiffLinesPayload, AsyncGenerator<DiffLine>];
153 "chatDescriber/describe": [
154 {
155 text: string;
156 },
157 string | undefined,
158 ];
159 "stats/getTokensPerDay": [
160 undefined,
161 { day: string; promptTokens: number; generatedTokens: number }[],
162 ];
163 "stats/getTokensPerModel": [
164 undefined,
165 { model: string; promptTokens: number; generatedTokens: number }[],
166 ];
167 "tts/kill": [undefined, void];
168
169 // Codebase indexing
170 "index/setPaused": [boolean, void];
171 "index/forceReIndex": [
172 undefined | { dirs?: string[]; shouldClearIndexes?: boolean },
173 void,
174 ];
175 "index/indexingProgressBarInitialized": [undefined, void];
176 "onboarding/complete": [CompleteOnboardingPayload, void];
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 }, void];
201 "controlPlane/getFreeTrialStatus": [undefined, FreeTrialStatus | null];
202 isItemTooBig: [{ item: ContextItemWithId }, boolean];
203 didChangeControlPlaneSessionInfo: [
204 { sessionInfo: ControlPlaneSessionInfo | undefined },
205 void,
206 ];
207 "process/markAsBackgrounded": [{ toolCallId: string }, void];
208 "process/isBackgrounded": [{ toolCallId: string }, boolean];
209 "mdm/setLicenseKey": [{ licenseKey: string }, boolean];
210};