Elffuss BraidHub

kikocis/continue public

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