Elffuss BraidHub

kikocis/continue public

8cf316c34504 · 3.1 KiBRawPermalink
1import type {
2 ContinueRcJson,
3 FileStatsMap,
4 FileType,
5 IDE,
6 IdeInfo,
7 IdeSettings,
8 IndexTag,
9 Location,
10 Problem,
11 Range,
12 RangeInFile,
13 SignatureHelp,
14 TerminalOptions,
15 Thread,
16} from "../";
17import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes";
18
19export interface GetGhTokenArgs {
20 force?: boolean;
21}
22
23export type ToIdeFromWebviewOrCoreProtocol = {
24 // Methods from IDE type
25 getIdeInfo: [undefined, IdeInfo];
26 getWorkspaceDirs: [undefined, string[]];
27 writeFile: [{ path: string; contents: string }, void];
28 showVirtualFile: [{ name: string; content: string }, void];
29 openFile: [{ path: string }, void];
30 openUrl: [string, void];
31 runCommand: [{ command: string; options?: TerminalOptions }, void];
32 getSearchResults: [{ query: string; maxResults?: number }, string];
33 getFileResults: [{ pattern: string; maxResults?: number }, string[]];
34 subprocess: [{ command: string; cwd?: string }, [string, string]];
35 saveFile: [{ filepath: string }, void];
36 fileExists: [{ filepath: string }, boolean];
37 readFile: [{ filepath: string }, string];
38 getProblems: [{ filepath: string }, Problem[]];
39 getOpenFiles: [undefined, string[]];
40 getCurrentFile: [
41 undefined,
42 (
43 | undefined
44 | {
45 isUntitled: boolean;
46 path: string;
47 contents: string;
48 }
49 ),
50 ];
51 getPinnedFiles: [undefined, string[]];
52 showLines: [{ filepath: string; startLine: number; endLine: number }, void];
53 readRangeInFile: [{ filepath: string; range: Range }, string];
54 getDiff: [{ includeUnstaged: boolean }, string[]];
55 getWorkspaceConfigs: [undefined, ContinueRcJson[]];
56 getTerminalContents: [undefined, string];
57 getDebugLocals: [{ threadIndex: number }, string];
58 getTopLevelCallStackSources: [
59 { threadIndex: number; stackDepth: number },
60 string[],
61 ];
62 getAvailableThreads: [undefined, Thread[]];
63 isTelemetryEnabled: [undefined, boolean];
64 isWorkspaceRemote: [undefined, boolean];
65 getUniqueId: [undefined, string];
66 getTags: [string, IndexTag[]];
67 readSecrets: [{ keys: string[] }, Record<string, string>];
68 writeSecrets: [{ secrets: Record<string, string> }, void];
69 // end methods from IDE type
70
71 getIdeSettings: [undefined, IdeSettings];
72
73 // Git
74 getBranch: [{ dir: string }, string];
75 getRepoName: [{ dir: string }, string | undefined];
76
77 showToast: [
78 Parameters<IDE["showToast"]>,
79 Awaited<ReturnType<IDE["showToast"]>>,
80 ];
81 getGitRootPath: [{ dir: string }, string | undefined];
82 listDir: [{ dir: string }, [string, FileType][]];
83 getFileStats: [{ files: string[] }, FileStatsMap];
84
85 gotoDefinition: [{ location: Location }, RangeInFile[]];
86 gotoTypeDefinition: [{ location: Location }, RangeInFile[]];
87 getSignatureHelp: [{ location: Location }, SignatureHelp | null];
88
89 getControlPlaneSessionInfo: [
90 { silent: boolean; useOnboarding: boolean },
91 ControlPlaneSessionInfo | undefined,
92 ];
93 logoutOfControlPlane: [undefined, void];
94 reportError: [any, void];
95 closeSidebar: [undefined, void];
96};
97
98export type ToWebviewOrCoreFromIdeProtocol = {
99 didChangeActiveTextEditor: [{ filepath: string }, void];
100};